开发者

Is there a PHP HTML tag library?

开发者 https://www.devze.com 2023-01-25 03:51 出处:网络
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 c

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消