0

I am doing the following in my controller to manually check a form, now I get an error saying

Fatal error: Class 'BizTV\ContentManagementBundle\Controller\formerror' not found in /var/www/cloudsign_beta/src/BizTV/ContentManagementBundle/Controller/DefaultController.php on line 233

so I suppose there is a fancy symfony form component I must add with a USE statement on top, anyone know which one?

    if ($nameOccupied=1) {          
        $error = new formerror("Det finns redan innehåll på denna plats med samma namn, vänligen välj ett annat namn (eller välj en annan plats).");
        $form->get('name')->addError($error);   
    }
4

1 回答 1

4

You are missing the following use statement:

use Symfony\Component\Form\FormError

Reference: http://api.symfony.com/2.3/Symfony/Component/Form/FormError.html

Important: When creating an object, you should use the same case than the one from the class definition to avoid failure on case sensitive systems.
Here, new formerror should be new FormError

于 2013-07-31T15:41:18.180 回答