In this video, I have shown how can we autoload in php. We use psr2 coding standard. We dumping autoload using composer. Which actually easiest way we can make autoload file. Source code will be available in following link
https://github.com/polodev/autoload_i...
autoloading in php using composer
composer is a dependency manager for php. Beside this, composer can be used to autoload php. In this video, I have shown how can we dump a autoload file using composer. Which actually saves a lot of times and efforts. we followed psr2 coding style
How to autoload classes
in composer.json file
"autoload": {
"classmap": ["fruits", "flowers"]
}
if we want to autoload every class of our project just pass root(./) as element of classmap array
"autoload": {
"classmap": ["./"]
}
How to autoload files
in composer.json file
"autoload": {
"files": ["db.php"],
}
dump-autoload or dumpautoload command
for dumping autoload file, cd into our project folder and type dumpautoload or dump-autoload command. Which will generate autoload folder for us.
My name in shibu deb polo
Thanks for watching
Please subscribe my channel
Take care
On this page of the site you can watch the video online php tutorial - autoload in php video - bangla with a duration of hours minute second in good quality, which was uploaded by the user Shibu Deb Polo 04 February 2018, share the link with friends and acquaintances, this video has already been watched 2,137 times on youtube and it was liked by 63 viewers. Enjoy your viewing!