php - auto loading class in symfony2 -
i use bundle: http://jmsyst.com/bundles/jmsi18nroutingbundle
, way explained in site occured error
classnotfoundexception: attempted load class "jmsi18nroutingbundle" namespace "jms\i18nroutingbundle" in c:\xampp\htdocs\symfony\app\appkernel.php line 20. need "use" namespace?
my configuration this: in app/autoload.php wrote add namespace alias:
$loader->add('jms', __dir__ .'/../vendor/bundles');
and in app/appkernel.php register bundle, in section error occured when register bundle.
new jms\i18nroutingbundle\jmsi18nroutingbundle(),
i copy library vendor/budles/jmsi18nroutingbundle
see - https://github.com/schmittjoh/jmsi18nroutingbundle/blob/master/composer.json
as can see, there defined full-path namespace
"autoload": { "psr-0": { "jms\\i18nroutingbundle": "" } },
try define
$loader->add('jms\\i18nroutingbundle', __dir__ .'/../vendor/bundles/jmsi18nroutingbundle');
and best way - use composer
Comments
Post a Comment