使用zend装饰器以zend格式创建错误的td
||
我用装饰器创建了一个zend表单。我使用了验证器。因此,当发生错误时,我想生成此代码:
<form enctype=\"application/x-www-form-urlencoded\" action=\"add\" method=\"post\" Name=\"addfrm\" class=\"textpos\" Id=\"addfrm\" name=\"\">
<table align=\"center\" class=\"tbcss\" width=\"84%\">
<tr>
<td align=\"right\" valign=\"top\" width=\"15%\"><label for=\"cou_name\" class=\"required\">Country Name :</label></td>
<td class=\"element\" width=\"100%\" valign=\"top\">
<input type=\"text\" name=\"cou_name\" id=\"cou_name\" value=\"\" size=\"39\" />
<img class=\"imgpos\" src=\"/zendf/public/images/help.gif\"></img>
</td>
<td>
<ul class=\"errors\">
<li>Country name is required.</li>
<li>Please Enter character data in country name.</li>
</ul>
</td>
</tr>
</table>
</form>
但实际上代码是这样生成的:
<form enctype=\"application/x-www-form-urlencoded\" action=\"add\" method=\"post\" Name=\"addfrm\" class=\"textpos\" Id=\"addfrm\" name=\"\">
<table align=\"center\" class=\"tbcss\" width=\"84%\">
<tr>
<td align=\"right\" valign=\"top\" width=\"15%\"><label for=\"cou_name\" class=\"required\">Country Name :</label></td>
<td class=\"element\" width=\"100%\" valign=\"top\">
<input type=\"text\" name=\"cou_name\" id=\"cou_name\" value=\"\" size=\"39\" />
<ul class=\"errors\">
<li>Country name is required.</li>
<li>Please Enter character data in country name.</li>
</ul>
<img class=\"imgpos\" src=\"/zendf/public/images/help.gif\"></img>
</td>
</tr>
</table>
</form>
我正在使用此装饰器:
公共$文本框=数组(
\'ViewHelper \',
array(\'Errors\'),
array(array(\'image \'=> \'HtmlTag \'),
array(\'tag \'=> \'img \',\'placement \'=>
\'append \',\'class \'=> \'imgpos \',\'src \'=> \'/ zendf / public / images / help.gif \')),
array(array(\''data \'=> \'HtmlTag \'),array(\'tag \'=> \'td \',\'class \'=>
\'element \',\'width \'=> \'100%\',\'valign \'=> \'top \')),
array(array(\'closeLabel\' => \'HtmlTag\'),array(\'tag\' => \'td\', \'closeOnly\' =>
true,\'placement \'=> \'prepend \')),
\'标签\',
array(array(\'openLabel \'=> \'HtmlTag \'),array(\'tag \'=> \'td \',
\'openOnly \'=> true,\'align \'=> \'right \',\'valign \'=> \'top \',\'width \'=> \'15%\')) ,
array(array(\'row\' => \'HtmlTag\'), array(\'tag\' => \'tr\')), );
我希望当错误发生时它将创建一个td并显示在其中。
谁能帮助我。
没有找到相关结果
已邀请:
1 个回复
你换