本文整理汇总了PHP中Engine_Form::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine_Form::init方法的具体用法?PHP Engine_Form::init怎么用?PHP Engine_Form::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine_Form
的用法示例。
在下文中一共展示了Engine_Form::init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
parent::init();
$this->addElement('Text', 'search', array('label' => 'Search Music:'));
$this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular')));
}
示例2: init
public function init()
{
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setMethod('GET')->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array('page' => null)));
parent::init();
$this->addElement('Text', 'search', array('label' => 'Search Polls:'));
$this->addElement('Select', 'show', array('label' => 'Show', 'multiOptions' => array('1' => 'Everyone\'s Polls', '2' => 'Only My Friends\' Polls'), 'onchange' => 'searchPolls();'));
$this->addElement('Select', 'closed', array('label' => 'Status', 'onchange' => 'searchPolls();', 'multiOptions' => array('' => 'All Polls', '0' => 'Only Open Polls', '1' => 'Only Closed Polls')));
$this->addElement('Select', 'order', array('label' => 'Browse By:', 'onchange' => 'searchPolls();', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular')));
}
示例3: init
public function init()
{
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()))->setMethod('GET');
parent::init();
$this->addElement('Text', 'search', array('label' => 'Search Music:'));
$this->addElement('Select', 'show', array('label' => 'Show', 'multiOptions' => array('1' => 'Everyone\'s Playlists', '2' => 'Only My Friends\' Playlists')));
$this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular')));
$this->addElement('Hidden', 'user');
$this->addElement('Hidden', 'page', array('order' => 100));
$this->addElement('Button', 'search_bt', array('label' => 'Search', 'type' => 'submit', 'order' => 101));
}
示例4: init
public function init()
{
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
parent::init();
$this->addElement('Text', 'search', array('label' => 'Search Albums:'));
$this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular')));
// prepare categories
$categories = Engine_Api::_()->getDbtable('categories', 'album')->getCategoriesAssoc();
if (count($categories) > 0) {
$this->addElement('Select', 'category_id', array('label' => 'Category', 'multiOptions' => $categories));
}
}
示例5: init
public function init()
{
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'));
parent::init();
$this->addElement('Text', 'search', array('label' => 'Search Albums:'));
$this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular')));
// prepare categories
$categories = Engine_Api::_()->getDbtable('categories', 'album')->getCategoriesAssoc();
if (count($categories) > 0) {
$this->addElement('Select', 'category_id', array('label' => 'Category', 'multiOptions' => $categories));
}
$this->addElement('Button', 'submit_btn', array('label' => 'Search', 'type' => 'submit', 'ignore' => true));
}
示例6: init
public function init()
{
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
parent::init();
$this->addElement('Text', 'search', array('label' => 'Search Albums:'));
$this->addElement('Select', 'sort', array('label' => 'Browse By:', 'multiOptions' => array('recent' => 'Most Recent', 'popular' => 'Most Popular')));
// prepare categories
$categories = Engine_Api::_()->album()->getCategories();
if (count($categories) != 0) {
$categories_prepared[0] = "";
foreach ($categories as $category) {
$categories_prepared[$category->category_id] = $category->category_name;
}
// category field
$this->addElement('Select', 'category_id', array('label' => 'Category', 'multiOptions' => $categories_prepared));
}
}
示例7: init
public function init()
{
$this->setAttribs(array('id' => 'login_contactimporter_form', 'class' => 'global_form'))->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
parent::init();
$request = Zend_Controller_Front::getInstance()->getRequest();
$type = $request->getParam('type');
$provider = $request->getParam('provider');
$label = "Email";
if ($type == 'user') {
$label = "Username";
}
$this->addElement('Text', 'email', array('label' => $label, 'required' => true));
$this->addElement('Password', 'password', array('label' => 'Password', 'required' => true));
$this->addElement('Hidden', 'provider', array('value' => $provider));
$this->addElement('Button', 'submit', array('label' => 'Import Contacts', 'type' => 'submit', 'link' => true, 'ignore' => true, 'decorators' => array('ViewHelper')));
$this->addElement('Button', 'cancel', array('label' => 'Cancel', 'link' => true, 'href' => '', 'onclick' => 'parent.Smoothbox.close();', 'decorators' => array('ViewHelper')));
// DisplayGroup: buttons
$this->addDisplayGroup(array('submit', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
}