简体   繁体   English

向表单元素,Volt引擎和Phalcon 3添加ID和属性

[英]Adding id and attributes to Form element, Volt engine and Phalcon 3

I was trying to add an id to form element in Phalcon using volt syntax. 我试图使用volt语法在Phalcon中添加一个id来形成元素。 But never found a solution for it. 但从未找到解决方案。

Here is how I render the form: 这是我渲染表单的方式:

{{ form("admin/saveSettings", "method": "post") }}

It is simple as that: 就这么简单:

{{ form("admin/saveSettings", "method": "post", "id": "form-id", "class": "css-class") }}

You can add more attributes by separating them with commas. 您可以通过使用逗号分隔添加更多属性。

More examples of Tag Helpers can be found in the docs . 可以在文档中找到标签助手的更多示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM