Is there a PHP HTML tag library for doing server-side HTML tags? Java and ASP.NET have these but those are comp开发者_如何转开发iled langs vs. scripted. For example, in ASP.NET, you define a textbox control using this:
<asp:TextBox />
And you can reference it server-side and assign properties, etc. Wasn't sure if such capability exists for PHP. Thanks.
There's not a built-in way to do it but template systems can add similar functionality. I personally use Smarty. It's not quite the same but it's similar.
For example, check boxes:
{ html_checkboxes name="foo" }
Or a date picker
{ html_select_date time=$some_unix_timestamp }
Also easy to extend it with plug-ins
Some frameworks have some implementations of this approach, e.g. form helper in CodeIgniter or view helpers in Zend framework.
精彩评论