我和奏鸣曲管理束有问题。我想做的是:
在我的表单中的一些标签之前添加一些文本。例如:
图像的分辨率必须是..x。。
例如,我有这样一个表单:
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('locale', 'choice', array(
'choices' => array('nl' => 'NL', 'en' => 'EN'),
'required' => true,
))
->add('pageid.tag', 'text', array('label' => 'Tag'))
->add('description', 'text', array('label' => 'Beschrijving'))
->add('content', 'textarea', array('label' => 'Tekst', 'attr' => array('class' => 'ckeditor')))
->add('files', 'file', array('required' => false, 'multiple' => true))
;
}现在,我想在文件输入字段之前添加一些文本。
我现在所做的是:
但是这将用于每个表单,我不能为特定的表单设置特定的表单模板吗?
发布于 2015-01-14 22:07:47
可以在管理类中指定覆盖getFormTheme方法的表单模板。将此代码添加到管理类中。
public function getFormTheme()
{
return array_merge(
parent::getFormTheme(),
array('MurisBundle:PageAdmin:form_admin_fields.html.twig')
);
} 发布于 2015-01-13 15:13:45
getPictureUrlFull().‘alt=’.$campaign->getPicture().‘style=’边距-顶部:10 top;“/>Use”帮助
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('locale', 'choice', array(
'choices' => array('nl' => 'NL', 'en' => 'EN'),
'required' => true,
'help' => '<img src="'.$entity->getPictureUrlFull().'" alt="'.$entity->getPicture().'" />'
))
)https://stackoverflow.com/questions/27925075
复制相似问题