我正在尝试呈现我刚刚从实体生成的表单,但我收到以下错误...
<?php
namespace Prueba\FrontendBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Prueba\FrontendBundle\Form\ItemType;
class DefaultController extends Controller
{
/**
* @Route("/hello")
* @Template()
*/
public function indexAction($name)
{
$form = new ItemType();var_dump(get_class($form));
return $this->render('AcmeTaskBundle:Default:new.html.twig', array(
'form' => $form->createView(),
));
}
}
string(35) "Prueba\FrontendBundle\Form\ItemType" 致命错误:调用 /home/javier/programacion/sf2000/src/Prueba/FrontendBundle/Controller/ 中未定义的方法 Prueba\FrontendBundle\Form\ItemType::createView()第 20 行的 DefaultController.php