本文整理匯總了PHP中Kwc_Abstract_Form::createComponentFormByDbIdTemplate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kwc_Abstract_Form::createComponentFormByDbIdTemplate方法的具體用法?PHP Kwc_Abstract_Form::createComponentFormByDbIdTemplate怎麽用?PHP Kwc_Abstract_Form::createComponentFormByDbIdTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Kwc_Abstract_Form
的用法示例。
在下文中一共展示了Kwc_Abstract_Form::createComponentFormByDbIdTemplate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _initFields
protected function _initFields()
{
parent::_initFields();
$this->add(new Kwf_Form_Field_TextField('title', trlKwf('Title')))->setAllowBlank(false)->setWidth(500);
$this->add(new Kwf_Form_Field_TextArea('teaser', trlKwf('Teaser')))->setWidth(500)->setHeight(100);
$this->add(new Kwf_Form_Field_DateField('date', trlKwf('Publication')))->setAllowBlank(false);
$this->add(new Kwf_Form_Field_Select('author_id', trlKwf('Author')))->setAllowBlank(false)->setWidth(200)->setValues(Kwf_Model_Abstract::getInstance('Kwc_Articles_Directory_AuthorsModel')->getRows());
$v = new Zend_Validate_Regex('/^[0-9]{4}\\/[0-9]{2}$/');
$v->setMessage(trlKwf('Please use this format -> Year / Month'), Zend_Validate_Regex::NOT_MATCH);
$this->add(new Kwf_Form_Field_TextField('vi_nr', trlKwf('VI-Number')))->setWidth(70)->addValidator($v);
$this->add(Kwc_Abstract_Form::createComponentFormByDbIdTemplate('article_{0}-previewImage', 'previewImage'));
$columns = $this->add(new Kwf_Form_Container_Columns('is_top'));
$col = $columns->add(new Kwf_Form_Container_Column());
$col->setStyle('margin-left: 0px');
$col->add(new Kwf_Form_Field_Checkbox('is_top_checked', trlKwf('Hot-topic')));
$col = $columns->add(new Kwf_Form_Container_Column());
$col->setLabelWidth(50);
$col->add(new Kwf_Form_Field_DateField('is_top_expire', trlKwf('Ends at')));
$this->add(new Kwf_Form_Field_Checkbox('read_required', trlKwf('Required reading')));
$this->add(new Kwf_Form_Field_Checkbox('only_intern', trlKwf('Only intern')));
$priority = array();
for ($i = 1; $i <= 10; $i++) {
$priority[$i] = $i;
}
$this->add(new Kwf_Form_Field_Select('priority', trlKwf('Priority')))->setAllowBlank(false)->setValues($priority)->setWidth(40)->setHelpText(trlKwfStatic('For sorting articles if they have same date'));
}