Is there a PHP HTML tag library?

北城以北 提交于 2019-12-13 13:17:23

问题


Is there a PHP HTML tag library for doing server-side HTML tags? Java and ASP.NET have these but those are compiled 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.


回答1:


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




回答2:


Some frameworks have some implementations of this approach, e.g. form helper in CodeIgniter or view helpers in Zend framework.



来源:https://stackoverflow.com/questions/4196955/is-there-a-php-html-tag-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!