本文整理汇总了PHP中Zend\Form\Form::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::init方法的具体用法?PHP Form::init怎么用?PHP Form::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\Form
的用法示例。
在下文中一共展示了Form::init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
// TODO: Change the autogenerated stub
$this->add(array('name' => 'cost', 'type' => 'Text', 'options' => array('label' => 'Цена в USD')));
$this->add(array('name' => 'currency', 'type' => 'DoctrineModule\\Form\\Element\\ObjectSelect', 'options' => array('object_manager' => $this->getServiceLocator()->getServiceLocator()->get('doctrine-document'), 'target_class' => 'Course\\Document\\Courses', 'label' => 'Валюта')));
$this->add(array('name' => 'countThread', 'type' => 'Select', 'options' => array('label' => 'Количество потоков', 'value_options' => array('1', '5', '10', '50', '100', '500', '1000'))));
$this->add(array('name' => 'start', 'type' => 'Button', 'options' => array('label' => 'Старт'), 'attributes' => array('class' => 'btn start')));
}
示例2: init
public function init()
{
parent::init();
$this->setAttribute('method', 'post');
$this->setHydrator(new ClassMethodsHydrator(false));
$this->setInputFilter(new InputFilter());
$this->add(['type' => 'Ajasta\\Client\\Form\\ClientFieldset', 'options' => ['use_as_base_fieldset' => true]]);
$this->add(['type' => 'button', 'name' => 'submit', 'options' => ['label' => 'Submit', 'column-size' => 'sm-12 form-action'], 'attributes' => ['type' => 'submit', 'class' => 'btn-primary']]);
}
示例3: init
public function init()
{
parent::init();
$this->setHydrator(new DoctrineHydrator($this->getObjectManager()))->setInputFilter(new InputFilter());
$this->add(array('name' => 'semester', 'type' => SemesterFieldset::class, 'options' => array('use_as_base_fieldset' => true)));
/*$this->add(array(
'name' => 'semester_csrf',
'type' => Csrf::class,
));*/
$this->add(array('name' => 'submit', 'type' => 'Submit', 'attributes' => array('value' => 'Save', 'class' => 'btn-success'), 'options' => array('as-group' => true)));
}
示例4: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->add(array('name' => 'csrf', 'type' => 'csrf', 'required' => true, 'validators' => array(array('name' => 'csrf'))));
}
示例5: init
public function init()
{
parent::init();
}
示例6: init
/**
* {@inheritDoc}
*/
public function init()
{
$this->getEventManager()->trigger(__FUNCTION__, $this);
parent::init();
if ($this->getOption('use_captcha')) {
$this->addCaptchaElement();
}
if ($this->getOption('use_csrf')) {
$this->addCsrfElement();
}
if ($this->getOption('use_submit_element')) {
$this->addSubmitElement();
}
if ($this->getOption('use_reset_element')) {
$this->addResetElement();
}
}