CaptchaBundle
CaptchaBundle copied to clipboard
Could not load type "Gregwar\CaptchaBundle\Type\CaptchaType"
error: Could not load type "Gregwar\CaptchaBundle\Type\CaptchaType" vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistry.php at line 83
Symfony 2.7.8: Installed bundle by composer require gregwar/captcha-bundle
bundle registered: $bundles = array( // ... new Gregwar\CaptchaBundle\GregwarCaptchaBundle(), ); configured: gregwar_captcha: ~
$builder->add('captcha', 'Gregwar\CaptchaBundle\Type\CaptchaType');
composer.json: "gregwar/captcha-bundle": "^2.0"
Hi.
He says
If you are using Symfony < 2.8, you should use version 1.*
So you should use "gregwar/captcha-bundle": "1.*". But I tried it on version 1.0 and it still shows the same error.
Unfortunately example is not correct or some step is missing.
strange
Hello, I have the same problem, I'm using symfony 2.7 and Captcha Bundle 1.* and I get error: Could not load type "Gregwar\CaptchaBundle\Type\CaptchaType" can anyone help?
I found solution:
- write in controller: $formBuilder = $this->createFormBuilder(); $formBuilder->add('captcha', 'captcha'); instead: $formBuilder->add('captcha', 'Gregwar\CaptchaBundle\Type\CaptchaType');
- Fix Gregwar\CaptchaBundle\Type\CaptchaType class public function getParent() { return 'text'; // Not using ::class to support Symfony 2.8 w/ php<5.5 //return 'Symfony\Component\Form\Extension\Core\Type\TextType'; }
I use Symfony2.3 and he gives me the same error with the Bundles any version: Could not load type "Gregwar\CaptchaBundle\Type\CaptchaType"
In sf <2.8 you should add a field of type "captcha" and in sf>=2.8 you should use CaptchaType::class Le 9 févr. 2016 22:02, "fjmg" [email protected] a écrit :
I use Symfony2.3 and he gives me the same error with the Bundles any version: Could not load type "Gregwar\CaptchaBundle\Type\CaptchaType"
— Reply to this email directly or view it on GitHub https://github.com/Gregwar/CaptchaBundle/issues/159#issuecomment-182066613 .
Thanks to answer so fast. I already did the change and now it evidences this error to me: FatalErrorException: Error: Class 'Gregwar\Captcha\CaptchaBuilder' not found in /media/Datos/sitios/kefacil/sitio/app/cache/dev/appDevDebugProjectContainer.php line 1844
Looks like composer didn't install the dependency with gregwar/captcha
You can give a try to composer install or something like this Le 9 févr. 2016 22:22, "fjmg" [email protected] a écrit :
Thanks to answer so fast. I already did the change and now it evidences this error to me: FatalErrorException: Error: Class 'Gregwar\Captcha\CaptchaBuilder' not found in /media/Datos/sitios/kefacil/sitio/app/cache/dev/appDevDebugProjectContainer.php line 1844
— Reply to this email directly or view it on GitHub https://github.com/Gregwar/CaptchaBundle/issues/159#issuecomment-182072867 .
Install the bundle within reach. From now on I put the steps that I followed to install the bundle to him "vendor\composer\autoload_namespaces.php"
array($vendorDir . '/bundles'), ' ' => array($baseDir . '/src'), ); ``` ?>"app\AppKernel.php" new Gregwar\CaptchaBundle\GregwarCaptchaBundle(),
Thank you very much for help
What happen when you run composer install?
The connection of internet is very bad. When I try to install with composer the connection time to it he expires to me. It went for me but easy discharging the bundle.
dont work
require 'vendor/autoload.php';
use Gregwar\Captcha\CaptchaBuilder;
This works
require 'vendor/autoload.php';
use Gregwar\Captcha\CaptchaBuilder;
Esto funciona muchas gracias ya me funciono a mi