0
问题视图 - 表单标签形式的打印元件: 当鉴于形式的打印元件,不创建的窗体标签Zend_Form的:当dod't创建
笔者认为:
<?php
/****** print elements and inser label:: have to be done in this way for integrate cushycms ********/
echo $this->form->empty;
?>
<label>Ad Title</label>
<?php
echo $this->form->adtitle;
?>
<label></label>
<?php echo $this->form->adbody; ?>
MY表(代码的一部分):
class MyForm extends Zend_Form
{
function init(){
$empty = new Zend_Form_Element_Hidden("empty");
$empty->removeDecorator('Label');
$title = new Zend_Form_Element('adtitle');
$title->removeDecorator('Label');
$title//->setLabel('Ad Title')
->setRequired('true')
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty')
->setAttrib('MAXLENGTH',100)
->setAttrib('Size',106);
$title->getValidator('NotEmpty')
->setMessage('Company Name can not be empty');
$body = new Zend_Form_Element_Textarea('adbody');
$body->removeDecorator('Label');
}
}
,我得到(表单标签不存在)的HTML:
<dd id="empty-element">
<input type="hidden" name="empty" value="" id="empty"></dd> <label>Ad Title</label>
<dd id="adtitle-element">
<input type="text" name="adtitle" id="adtitle" value="" MAXLENGTH="100" Size="106"></dd><label></label>
<dd id="adbody-element">
<textarea name="adbody" id="adbody" onKeyDown="javascript:limitText(this.form.countdown,400)" onKeyUp="javascript:limitText(this.form.countdown,400)" rows="24" cols="80"></textarea></dd> <label>chras left (maximum 400): </label>
非常感谢您
非常感谢您! – Yosef 2010-07-01 18:31:12
<形式行动= “= $this->逃逸($这 - >形式 - >的getAction()?>” 方法= “= $this->逃逸($这 - >形式 - > getMethod()?>” > 不工作时,其只显示没有动作和方法的值