Posted By

pkmojs on 11/06/12


Tagged

autoload symfony2


Versions (?)

Autoload symfony2 components


 / Published in: PHP
 

Add this snippet's code in a file called autoload.php and use it from external php files

  1. <?php
  2. require_once __DIR__.'/Symfony/Component/ClassLoader/UniversalClassLoader.php';
  3. use Symfony\Component\ClassLoader\UniversalClassLoader;
  4.  
  5. $loader = new UniversalClassLoader();
  6. $loader->registerNamespace('Symfony\Component', __DIR__.'Symfony/Component');
  7. $loader->useIncludePath(true);
  8. $loader->register();
  9. ?>

Report this snippet  

You need to login to post a comment.