Chciałem dodać pakiet Sonata LINK i nie wiem jak dodać ten kod, tak aby działał:

  1. <?php
  2. $loader->registerNamespaces(array(
  3. 'Sonata' => __DIR__,
  4.  
  5. // ... other declarations
  6. ));



Dodałem go do pliku app/autoload.php i wychodzi lipa, mam wrażenie że nie wklejam tego we właściwych linijkach. Mój autoload.php:
  1. <?php
  2.  
  3. use Doctrine\Common\Annotations\AnnotationRegistry;
  4.  
  5.  
  6. $loader = require __DIR__.'/../vendor/autoload.php';
  7.  
  8. $loader->registerNamespaces(array(
  9. 'Sonata' => __DIR__,
  10.  
  11. // ... other declarations
  12. ));
  13.  
  14. // intl
  15. if (!function_exists('intl_get_error_code')) {
  16. require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
  17.  
  18. $loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
  19. }
  20.  
  21. AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
  22.  
  23. return $loader;




Odświerzam, pomoże mi ktoś?