Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Symfony 2.2 中可以通过以下方式访问模板中的表单字段属性:
<?php $form['field_name']->get('field_attribute') ?>
我如何在 Symfony 2.3 中做到这一点?FormView 对象不再具有此功能。
编辑 :
实际上 FormView 不再具有get功能,而是您拥有:
get
array $vars The variables assigned to this view.
树枝中的类似物:{{ form.task.vars.full_name }}
{{ form.task.vars.full_name }}
文档上的 PHP 片段似乎已经过时