【发布时间】:2017-09-14 09:14:56
【问题描述】:
StudentType.php
$builder->add('internalId', null, array(
'label' => "Student ID",
'attr' => array('class' => 'studentInternalId', 'size' => 10, 'readonly' => 'readonly', 'placeholder' => 'Auto-generated', 'style' => 'width: 80px;', 'tabindex' => '-1', 'style' => 'pointer-events:none; opacity: 0.8; cursor: not-allowed')
));
index.html.twig
{{ form_row(contractStudent.student.internalId) }}
输出:
Label : InputField
我可以为 Label 编写单独的代码,为在 index.html.twig 文件中显示的值编写单独的代码吗?
我想在用户点击链接时创建一个价值链接,我会将用户带到另一个页面。为此,我需要该字段值。
【问题讨论】: