本文整理汇总了PHP中Zend\Form\Element\Submit::setIgnore方法的典型用法代码示例。如果您正苦于以下问题:PHP Submit::setIgnore方法的具体用法?PHP Submit::setIgnore怎么用?PHP Submit::setIgnore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\Element\Submit
的用法示例。
在下文中一共展示了Submit::setIgnore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setMethod('POST');
$element = new Element\Text('title');
$element->setLabel('Title:');
$element->setRequired(true);
$this->addElement($element);
$element = new Element\Select('name');
$element->setLabel('Directory:');
$element->setRequired(true);
$element->addMultiOptions($this->model->getThemesDirectoriesFromFS());
$this->addElement($element);
$element = new Element\Radio('active');
$element->setSeparator(' ');
$element->setLabel('Active:');
$element->setValue(false);
$element->setMultiOptions(array('1' => 'Yes', '0' => 'No'));
$element->setRequired(true);
$this->addElement($element);
$element = new Element\Text('ordering');
$element->setLabel('Ordering:');
$element->setRequired(true);
$this->addElement($element);
$element = new Element\Submit('submit');
$element->setLabel('Save');
$element->setIgnore(true);
$this->addElement($element);
}
示例2: init
/**
* Form initialization
*/
public function init()
{
$this->setMethod('POST');
$themes = $this->model->getlist();
$themesList = array();
foreach ($themes as $theme) {
$layoutsList = array();
foreach ($theme->getLayouts() as $layout) {
$layoutsList[$layout->getId()] = $layout->getTitle();
}
$themesList[$theme->getTitle()] = $layoutsList;
}
$element = new Element\Select('layout_id');
$element->setLabel('Theme layout:')->addMultiOptions($themesList)->addDecorator('fieldset')->setRequired(true);
$this->addElement($element);
$element = new Element\Text('name');
$element->setLabel('Widget name:')->setRequired(true);
$this->addElement($element);
$element = new Element\Text('placeholder');
$element->setLabel('Position:')->setRequired(true);
$this->addElement($element);
$this->addDisplayGroup(array('placeholder', 'name'), 'place', array('order' => 2, 'legend' => 'Display options:'));
if ($this->locator->instanceManager()->hasAlias('sysmap-service')) {
$sysmapElement = $this->locator->get('sysmap-service')->getMapFormElement();
if (!empty($sysmapElement)) {
$actionNavigator = clone $sysmapElement;
if ($actionNavigator instanceof \Zly\Form\Element\Tree) {
$actionNavigator->setName('map_id');
$actionNavigator->setRequired();
$actionNavigator->setLabel('Widget content provider action:');
$actionNavigator->addDisableCondition('level', new \Zend\Validator\LessThan(3));
$this->addElement($actionNavigator);
}
$displayNavigator = clone $sysmapElement;
if ($displayNavigator instanceof \Zly\Form\Element\Tree) {
$displayNavigator->setName('widget_points');
$displayNavigator->setLabel('Widget display pages:');
$displayNavigator->setRequired();
$displayNavigator->setMultiple(true);
$this->addElement($displayNavigator);
}
}
}
$element = new Element\Text('ordering');
$element->addValidator(new \Zend\Validator\Int())->setRequired(true)->setLabel('Ordering:')->setAttrib('style', 'width:50px;');
$this->addElement($element);
$element = new Element\Checkbox('published');
$element->setLabel('Published:');
$this->addElement($element);
$this->addDisplayGroup(array('ordering', 'published'), 'other', array('legend' => 'Publishing options:'));
$element = new Element\Hidden('module');
$element->removeDecorator('Label')->removeDecorator('HtmlTag')->setValue($this->_defaultValue);
$this->addElement($element);
$element = new Element\Hidden('controller');
$element->removeDecorator('Label')->setValue($this->_defaultValue)->removeDecorator('HtmlTag');
$this->addElement($element);
$element = new Element\Hidden('action');
$element->removeDecorator('Label')->setValue($this->_defaultValue)->removeDecorator('HtmlTag');
$this->addElement($element);
$element = new Element\Submit('submit');
$element->setLabel('Save');
$element->setIgnore(true);
$this->addElement($element);
foreach ($this->getDisplayGroups() as $group) {
$group->setDecorators(array('description', 'FormElements', 'fieldset'));
}
foreach ($this->getSubForms() as $group) {
$group->setDecorators(array('description', 'FormElements', 'fieldset'));
}
}