Here is the error I get :
Fatal error: Class 'bnd\myBundle\Controller\pageApproachUpdateType' not found in C:\wamp\www\Symfony\src\bnd\myBundle\Controller\NTController.php on line 208
As if Symfony was looking for the wrong directory…
Yet, in the same NTController.php, I already have some code to call a form which works fine. I just copied/renamed/pasted those lines to match the right Type and Handler.
Here is an extract of the Controller/NTController.php :
public function pageApproachUpdateAction($pageId)
{
$em=$this->getDoctrine()->getEntityManager();
$page = $em->getRepository('bndmyBundle:Page')->find($pageId);
$formNT = $this->createForm(new pageApproachUpdateType, $page);
$formHandler = new pageApproachUpdateHandler($formNT, $this->get('request'), $this->getDoctrine()->getEntityManager());
----
}
and an extract of the form type, Form/pageApproachUpdateType.php :
namespace bnd\myBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class pageApproachUpdateType extends AbstractType
{
---
}
I tried to clear the cache ; I just don’t understant what I missed…
You need to add the use statement for pageApproachUpdateType at the top of your NTController.php file: