Comparison between PSR-0 and PSR-4 in Laravel
PSR -0 and PSR-4 are standards for autoloading classes. PSR-0 has backward compatibility but PSR-4 only support namespaced code. The folder structure is different for PSR-0 and PSR-4. PSR-0 is depricated. We can see the directories in which the namespaces are mapped in composer.json. It doesnot replace underscores with directory seperator. In PSR-4 autoload the path to directory will be like App\Controller\IndexController --> dir/IndexController.php. In PSR-0 autoload will be App\Controller\IndexController -->dir/App/Controller/IndexController.php.
Comments
0 comments
Please Sign in or Create an account to Post Comments