0
我是sf2
的世界新人,我正在努力學習它。 我用作曲者安裝了TrSteelCkEditorBundle
,現在我試圖在視圖中獲取編輯器。 我的包在AppKernel
中處於活動狀態。如何在Symfony2中使用TrSteelCkEditorBundle?
作爲一個初學者,我的問題是: 我需要做什麼才能使它工作? 我把這個代碼並將其粘貼在價值渲染
$form = $this->createFormBuilder()
->add('title', 'text')
->add('content', 'ckeditor', array(
'transformers' => array(),
))
->getForm();
而且在樹枝觀點,我有6行:
{{ form_widget(form) }}
但我得到一個錯誤:
An exception has been thrown during the rendering of a template ("Catchable Fatal Error:
Argument 1 passed to Symfony\Component\Form\FormRenderer::searchAndRenderBlock()
must be an instance of Symfony\Component\Form\FormView,
instance of Symfony\Component\Form\Form given, called in
/Applications/mamp/htdocs/Sf2/app/cache/dev/twig/5c/eb/e10823d760716de7f56b39640e79.php
on line 29 and defined in
/Applications/mamp/htdocs/Sf2/vendor/symfony/symfony/src/Symfony/Component/Form/FormRenderer.php
line 131") in amTestBundle:Default:index.html.twig at line 6.
如果有人有線索解決它,它會幫助我很多。 謝謝。
謝謝,我忘記了那個重要的細節。現在我有一個錯誤:''Route「route_name」does not exist'。所以我必須在某處定義路由,所以控制器知道在哪裏找到表單。 – Gnarok