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
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": ["./"]
}
in composer.json file
"autoload": {
"files": ["db.php"],
}
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