本文整理汇总了PHP中Zend_Form_Element_Xhtml::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Xhtml::__construct方法的具体用法?PHP Zend_Form_Element_Xhtml::__construct怎么用?PHP Zend_Form_Element_Xhtml::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Xhtml
的用法示例。
在下文中一共展示了Zend_Form_Element_Xhtml::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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);
}
示例2: __construct
/**
* Constructor
*
* @param string|array|Zend_Config $spec Element name or configuration
* @param string|array|Zend_Config $options Element value or configuration
* @return void
*/
public function __construct($spec, $options = null)
{
if (is_string($spec) && (null !== $options && is_string($options))) {
$options = array('label' => $options);
}
parent::__construct($spec, $options);
}
示例3: __construct
/**
* Constructor
*
* Creates session namespace for CSRF token, and adds validator for CSRF
* token.
*
* @param string|array|Zend_Config $spec
* @param array|Zend_Config $options
* @return void
*/
public function __construct($spec, $options = null)
{
parent::__construct($spec, $options);
$this->setAllowEmpty(false)
->setRequired(true)
->initCsrfValidator();
}
示例4: __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);
}
示例5: __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);
}
示例6: __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);
}
示例7: __construct
/**
* Constructor
*
* @param string|array|Zend_Config $spec Element name or configuration
* @param string|array|Zend_Config $options Element value or configuration
* @return void
*/
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);
}
示例8: __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);
}
示例9: __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);
}
示例10: __construct
/**
* Constructor
*
* $spec may be:
* - string: name of element
* - array: options with which to configure element
* - Zend_Config: Zend_Config with options for configuring element
*
*
* Chosen options can be set in array two ways first by DQL second simple array.
*
* To set options by DQL $options array structure should be like:
* [
* 'dql' => "select u.username from \\Entities\\User where u.username IS NOT NULL", //mandatory
* 'db' => "default" //Optional if db is not default. Some project may have more then one.
* ]
*
* To set options by array $options array structure should be like:
* [
* 'options' => [ 'option1' => 'option1', 'option2' => 'option2', 'option3' => 'option3' ], //mandatory
* ]
*
*
* @param string|array|Zend_Config $spec
* @return void
*
* @see setChosenOptions()
* @see setChosenOptionsByDql()
*/
public function __construct($spec, $options = null)
{
if (isset($options['options'])) {
$this->setChosenOptions($options['options']);
unset($options['options']);
} else {
if (isset($options['dql'])) {
if (isset($options['db'])) {
$this->setChosenOptionsByDql($options['dql'], $options['db']);
unset($options['db']);
} else {
$this->setChosenOptionsByDql($options['dql']);
}
unset($options['dql']);
}
}
parent::__construct($spec, $options);
}
示例11: __construct
public function __construct($spec, $options = null)
{
parent::__construct($spec, $options);
}
示例12: __construct
/**
* Constructor
*
* @param string $spec
* @param array $options
* @return void
*/
public function __construct($spec, $options = null)
{
$this->addPrefixPath('Rexmac\\Zyndax\\Form\\Decorator\\', 'Rexmac/Zyndax/Form/Decorator', 'decorator');
parent::__construct($spec, $options);
}
示例13: __construct
/**
* Constructor
*
* $spec may be:
* - string: name of element
* - array: options with which to configure element
* - \Zend_Config: \Zend_Config with options for configuring element
*
* @param \Zend_Form $subForm
* @param string|array|\Zend_Config $spec
* @throws \Zend_Form_Exception if no element name after initialization
*/
public function __construct(\Zend_Form $subForm, $spec, $options = null)
{
$this->setSubForm($subForm);
parent::__construct($spec, $options);
}
示例14: __construct
/**
* Constructor
*
* @param string $spec
* @param array $options
* @return void
*/
public function __construct($spec, $options = null)
{
$this->addPrefixPath('Rexmac\\Zyndax\\Form\\Decorator\\', 'Rexmac/Zyndax/Form/Decorator', 'decorator');
$this->setTimeZone(isset($options['timeZone']) ? $options['timeZone'] : new DateTimeZone('UTC'));
$this->setRangedDates(self::_calculateRangedDates($this->getTimeZone()));
$this->setRange(self::TODAY);
parent::__construct($spec, $options);
}
示例15: __construct
/**
* Инициализируем переводчик и дергаем родительский конструктор
*
* @param mixed $spec
* @param array $options
*/
public function __construct($spec, $options = null)
{
$this->translate = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('Translate');
parent::__construct($spec, $options);
}