Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Zend:标签标签的自定义装饰器_Php_Html_Zend Framework_Zend Form - Fatal编程技术网

Php Zend:标签标签的自定义装饰器

Php Zend:标签标签的自定义装饰器,php,html,zend-framework,zend-form,Php,Html,Zend Framework,Zend Form,我目前有以下代码来生成表单元素(文本框): 这将以HTML格式输出以下内容: <dt id="username-label"><label for="username" class="optional">Username</label></dt> <dd id="username-element"> <input type="text" name="username" id="username" value="" class="i

我目前有以下代码来生成表单元素(文本框):

这将以HTML格式输出以下内容:

<dt id="username-label"><label for="username" class="optional">Username</label></dt>
<dd id="username-element">
<input type="text" name="username" id="username" value="" class="input"></dd>
用户名
但是,我希望它能输出以下内容:

<dt id="username-label"><label for="username" class="**label**">Username</label></dt>
<dd id="username-element">
<input type="text" name="username" id="username" value="" class="input"></dd>
用户名
为什么即使我告诉标签在decorator定义中使用标签类,标签也不接受标签类?我做错什么了吗


谢谢

用于呈现元素标签的代码


$this->form->name->renderLabel()

装饰器中的标签类设置在哪里?您只传递了
标记
放置
选项
<dt id="username-label"><label for="username" class="**label**">Username</label></dt>
<dd id="username-element">
<input type="text" name="username" id="username" value="" class="input"></dd>