0
使用單一的調用方式操作在控制器:我怎麼能在樹枝
$entity = new Goods();
$form = $this->createForm(new GoodsType(), $entity, array(
'action' => $this->generateUrl('shop_goods_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
return $this->render('ShopAdminBundle:Goods:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
在View: 我想獲得操作URL。這就像表格形式(form.action),我知道這是不對的,希望誰可以告訴我一個正確的方法
好吧,我只是想知道是否$這個 - >的CreateForm()調用表單模板(form.action)方法類似。但是Thx〜 – 2014-09-01 09:20:01