本文整理汇总了PHP中Zend_Form_Element_Xhtml类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Xhtml类的具体用法?PHP Zend_Form_Element_Xhtml怎么用?PHP Zend_Form_Element_Xhtml使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Form_Element_Xhtml类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: loadDefaultDecorators
public function loadDefaultDecorators()
{
parent::loadDefaultDecorators();
$this->removeDecorator('Label');
$this->removeDecorator('HtmlTag');
$this->addDecorator('HtmlTag', array('tag' => 'span', 'class' => 'spanImg'));
}
开发者ID:redaumore,项目名称:promociones,代码行数:7,代码来源:Img.php
示例2: __construct
public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' => true));
parent::__construct($spec, $options);
$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}
开发者ID:sdgdsffdsfff,项目名称:auth-center,代码行数:7,代码来源:Richtextarea.php
示例3: __construct
/**
* constructor
* @param $spec
* @param $options
*/
public function __construct($spec, $options = null)
{
$objLoader = new PluginLoader();
$objLoader->setPluginLoader($this->getPluginLoader(PluginLoader::TYPE_FORM_DECORATOR));
$objLoader->setPluginType(PluginLoader::TYPE_FORM_DECORATOR);
$this->setPluginLoader($objLoader, PluginLoader::TYPE_FORM_DECORATOR);
parent::__construct($spec, $options);
}
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:13,代码来源:form.element.xhtml.abstract.class.php
示例4: isValid
/**
* Override isValid()
*
* Ensure that validation error messages mask password value.
*
* @param string $value
* @param mixed $context
* @return bool
*/
public function isValid($value, $context = null)
{
foreach ($this->getValidators() as $validator) {
if ($validator instanceof Zend_Validate_Abstract) {
$validator->setObscureValue(true);
}
}
return parent::isValid($value, $context);
}
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:18,代码来源:Password.php
示例5: __construct
public function __construct($spec, $options = null)
{
$localOptions = array('filters' => array('StringTrim'), 'label' => 'Date and time', 'validators' => array(new \Tillikum\Validate\FormDatetime()));
if (isset($options)) {
$options = array_replace_recursive($localOptions, $options);
} else {
$options = $localOptions;
}
parent::__construct($spec, $options);
}
开发者ID:tillikum,项目名称:tillikum-core-module,代码行数:10,代码来源:Datetime.php
示例6: __construct
public function __construct($spec, $options = null)
{
if (is_string($spec) && (null !== $options && is_string($options))) {
$options = array('label' => $options);
}
if (!isset($options['ignore'])) {
$options['ignore'] = true;
}
parent::__construct($spec, $options);
}
开发者ID:knatorski,项目名称:SMS,代码行数:10,代码来源:Note.php
示例7: __construct
public function __construct($spec, $options = null)
{
$localOptions = array('filters' => array('StringTrim'));
if (isset($options)) {
$options = array_replace_recursive($localOptions, $options);
} else {
$options = $localOptions;
}
parent::__construct($spec, $options);
}
开发者ID:tillikum,项目名称:tillikum-core-module,代码行数:10,代码来源:Search.php
示例8: getLabel
/**
* Return label
*
* If no label is present, returns the currently set name.
*
* If a translator is present, returns the translated label.
*
* @return string
*/
public function getLabel()
{
$value = parent::getLabel();
if (null === $value) {
$value = $this->getName();
}
if (null !== ($translator = $this->getTranslator())) {
return $translator->translate($value);
}
return $value;
}
开发者ID:jpbender,项目名称:mage_virtual,代码行数:20,代码来源:Submit.php
示例9: getValue
public function getValue()
{
if (is_array($this->_value)) {
$value = $this->_value['year'] . '-' . $this->_value['month'] . '-' . $this->_value['day'];
if ($value == '--') {
$value = null;
}
$this->setValue($value);
}
return parent::getValue();
}
开发者ID:ncsuwebdev,项目名称:otframework,代码行数:11,代码来源:Date.php
示例10: __construct
/**
* Определяем массив ролей и уровней доступа и дергаем родительский конструктор
*
* @param unknown_type $spec
* @param unknown_type $options
*/
public function __construct($spec, $options = null)
{
/**
* @see Phorm_User
*/
require_once "Phorm/User.php";
$User = new Phorm_User();
$options['roles'] = $User->getRolesListAsPairs();
$options['levels'] = $User->getAccessLevelsAsPairs();
parent::__construct($spec, $options);
}
开发者ID:ei-grad,项目名称:phorm,代码行数:17,代码来源:AclMultiSelect.php
示例11: isRequired
public function isRequired()
{
$elements = $this->getElements();
if (empty($elements)) {
return parent::isRequired();
}
foreach ($elements as $el) {
if ($el->isRequired()) {
return true;
}
}
return false;
}
开发者ID:crlang44,项目名称:frapi,代码行数:13,代码来源:Group.php
示例12: __call
/**
* Overloading: allow rendering specific decorators
*
* Call renderDecoratorName() to render a specific decorator.
*
* @param string $method
* @param array $args
* @return \MUtil_Html_HtmlElement or at least something that implements the \MUtil_Html_HtmlInterface interface
* @throws \Zend_Form_Exception for invalid decorator or invalid method call
*/
public function __call($method, $args)
{
if ('render' == substr($method, 0, 6)) {
return parent::__call($method, $args);
}
$elem = \MUtil_Html::createArray($method, $args);
$value = $this->getValue();
if (!$value instanceof \MUtil_Html_ElementInterface) {
$value = new \MUtil_Html_Sequence();
}
$value->append($elem);
$this->setValue($value);
return $elem;
}
开发者ID:GemsTracker,项目名称:MUtil,代码行数:24,代码来源:Html.php
示例13: isValid
public function isValid($value, $context = null)
{
if (!is_array($value)) {
return false;
}
$result = checkdate((int) $value['month'], (int) $value['day'], (int) $value['year']);
if ($result == false) {
$value = null;
}
if ($this->max_year && (int) $value['year'] > $this->max_year || $this->min_year && (int) $value['year'] < $this->min_year) {
$value = null;
}
return parent::isValid($value, $context);
}
开发者ID:georgepaul,项目名称:songslikesocial,代码行数:14,代码来源:Date.php
示例14: isValid
/**
* Validate upload
*
* @param string $value
* @param mixed $context
* @return bool
*/
public function isValid($value, $context = null)
{
if (isset($_FILES[$this->getName()])) {
$value = $_FILES[$this->getName()]['tmp_name'];
$context = $_FILES[$this->getName()];
$context['destination'] = $this->_destination;
}
$isValid = parent::isValid($value, $context);
// If it's valid, we move the file to its final destination
if ($isValid && isset($this->_destination)) {
$destination = is_dir($this->_destination) ? $this->_destination . '/' . $context['name'] : $this->_destination;
move_uploaded_file($value, $destination);
}
return $isValid;
}
开发者ID:Tony133,项目名称:zf-web,代码行数:22,代码来源:File.php
示例15: setValue
public function setValue($value)
{
if (is_array($value)) {
if (isset($value['value'])) {
parent::setValue($value['value']);
}
if (isset($value['overwrite'])) {
if ($value['overwrite'] == '1' || $value['overwrite'] === true) {
$this->overwrite = true;
} else {
$this->overwrite = false;
}
}
} else {
parent::setValue($value);
}
}
开发者ID:hausdesign,项目名称:zf-library,代码行数:17,代码来源:TextareaOverwrite.php
示例16: isValid
public function isValid($value, $context = null)
{
$fieldName = $this->getName();
$auxiliaryFieldsNames = $this->getDayMonthYearTimeFieldNames($fieldName);
if (isset($context[$auxiliaryFieldsNames['day']]) && isset($context[$auxiliaryFieldsNames['month']]) && isset($context[$auxiliaryFieldsNames['year']]) && isset($context[$auxiliaryFieldsNames['hour']]) && isset($context[$auxiliaryFieldsNames['minutes']]) && isset($context[$auxiliaryFieldsNames['ampm']])) {
if ($context[$auxiliaryFieldsNames['year']] == '-' || $context[$auxiliaryFieldsNames['month']] == '-' || $context[$auxiliaryFieldsNames['day']] == '-' || $context[$auxiliaryFieldsNames['hour']] == '-' || $context[$auxiliaryFieldsNames['minutes']] == '-' || $context[$auxiliaryFieldsNames['ampm']] == '-') {
$value = null;
} else {
$hour = $context[$auxiliaryFieldsNames['hour']];
if ($context[$auxiliaryFieldsNames['ampm']] == 'pm') {
$hour += 12;
}
$value = str_pad($context[$auxiliaryFieldsNames['year']], 4, '0', STR_PAD_LEFT) . '-' . str_pad($context[$auxiliaryFieldsNames['month']], 2, '0', STR_PAD_LEFT) . '-' . str_pad($context[$auxiliaryFieldsNames['day']], 2, '0', STR_PAD_LEFT) . ' ' . str_pad($hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($context[$auxiliaryFieldsNames['minutes']], 2, '0', STR_PAD_LEFT) . ':00';
}
$this->setValue($value);
}
return parent::isValid($value, $context);
}
开发者ID:sdgdsffdsfff,项目名称:auth-center,代码行数:18,代码来源:DateTime.php
示例17: isValid
public function isValid($value, $context = null)
{
// for a file upload, the value is not in the POST array, it's in $_FILES
$key = $this->getName();
if ($value === null) {
if (isset($_FILES[$key])) {
$value = $_FILES[$key];
}
}
// auto insert ValidFile validator
if ($this->isRequired() && $this->autoInsertValidFileValidator() && !$this->getValidator('ValidFile')) {
$validators = $this->getValidators();
$validFile = array('validator' => 'ValidFile', 'breakChainOnFailure' => true);
array_unshift($validators, $validFile);
$this->setValidators($validators);
// do not use the automatic NotEmpty Validator as ValidFile replaces it
$this->setAutoInsertNotEmptyValidator(false);
}
return parent::isValid($value, $context);
}
开发者ID:jeremykendall,项目名称:spaz-api,代码行数:20,代码来源:File.php
示例18: __construct
/**
* Определяем массив опций и дергаем родительский конструктор
*
* @param mixed $spec
* @param array $options
*/
public function __construct($spec, $options = null)
{
$this->translate = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('Translate');
/**
* Выделяем дополнительные элементы в отдельную форму и рендерим ее
*/
require_once 'Phorm/Form.php';
if (isset($options['elements']) && is_array($options['elements'])) {
$config = array('elements' => $options['elements']);
if (isset($options['paths']['prefixPath'])) {
$config['prefixPath'] = array_values($options['paths']['prefixPath']);
}
if (isset($options['paths']['elementPrefixPath'])) {
$config['elementPrefixPath'] = array_values($options['paths']['elementPrefixPath']);
}
/*foreach ($options as $key=>$option) {
if(!in_array($key,array('elements','prefixPath','elementPrefixPath'))) {
unset($options[$key]);
}
}*/
$form = new Phorm_Form(null, null, $config);
$form->removeDecorator('Form');
$form->removeDecorator('DtDdWrapper');
$form->setElementsBelongTo($spec . '[]');
$this->renderform = $form->render() . '<div class="clear"></div>';
unset($options['elements'], $config['elements']);
foreach ($form->getElements() as $element) {
$element->setAttrib('id', null);
}
$this->form = $form;
}
/**
* Инициализируем родительский конструктор
*/
parent::__construct($spec, $options);
}
开发者ID:ei-grad,项目名称:phorm,代码行数:42,代码来源:MultiElement.php
示例19: isValid
public function isValid($value, $context = null)
{
// Empty
if ($this->getAllowEmpty() && (empty($value) || is_array($value) && 0 == count(array_filter($value)))) {
return parent::isValid($value, $context);
}
$this->setValue($value);
$value = $this->getValue();
// Normal processing
if (is_string($value)) {
if (preg_match('/^(\\d{4})-(\\d{2})-(\\d{2})( (\\d{2}):(\\d{2})(:(\\d{2}))?)?$/', $value, $m)) {
$year = $m[1];
$month = $m[2];
$day = $m[3];
$hour = @$m[5];
$minute = @$m[6];
} else {
$this->addError('Please select a date from the calendar.');
return false;
}
} else {
if (is_array($value)) {
$m = explode('/', $value['date']);
if (count($m) === 3) {
$year = $m[stripos($this->dateFormat, 'y')];
$month = $m[stripos($this->dateFormat, 'm')];
$day = $m[stripos($this->dateFormat, 'd')];
} else {
$year = null;
$month = null;
$day = null;
}
if (isset($value['hour']) && in_array($value['hour'], $this->getHourOptions())) {
$hour = $value['hour'];
}
if (isset($value['minute']) && in_array($value['minute'], $this->getMinuteOptions())) {
$minute = $value['minute'];
}
if (isset($value['ampm']) && in_array($value['ampm'], $this->getAMPMOptions())) {
if ($value['ampm'] == 'pm' && $hour < 12 && null !== $hour) {
$hour += 12;
} else {
if ($value['ampm'] == 'AM' && $hour == 12) {
$hour = 0;
}
}
}
}
}
// Check validity
if (!$year || !$month || !$day) {
$this->addError('Please select a date from the calendar.');
return false;
}
if (!$hour || !$minute) {
$this->addError('Please select a time from the dropdown.');
return false;
}
if ($month < 1 || $month > 12) {
$this->addError('Please select a date from the calendar.');
return false;
}
if ($day < 1 || $day > 31) {
$this->addError('Please select a date from the calendar.');
return false;
}
//if( $this->_useMilitaryTime() ) {
if ($hour < 0 || $hour > 23) {
$this->addError('Please select a time from the dropdown.');
return false;
}
//} else {
// if( $hour < 1 || $hour > 12 ) {
// $this->addError('Please select a time from the dropdown.');
// return false;
// }
//}
if ($minute < 0 || $minute >= 60) {
$this->addError('Please select a time from the dropdown.');
return false;
}
return parent::isValid($value, $context);
}
开发者ID:robeendey,项目名称:ce,代码行数:83,代码来源:CalendarDateTime.php
示例20: render
/**
* Render CSRF token in form
*
* @param Zend_View_Interface $view
* @return string
*/
public function render(Zend_View_Interface $view = null)
{
$this->initCsrfToken();
return parent::render($view);
}
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:11,代码来源:Hash.php
注:本文中的Zend_Form_Element_Xhtml类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论