CakePHP3 Tutorial

Next: Model the Database Table UP: TOC

With the help of bake we can create to folder structure for the plugin.

Change directory to the root of the application

cd /usr/local/www.... # ./bin/cake bake plugin wnkTaskManager Welcome to CakePHP v3.1.0-RC1 Console --------------------------------------------------------------- App : src Path: /usr/local/www/..../src/ PHP : 5.6.12 --------------------------------------------------------------- Plugin Name: WnkTaskManager Plugin Directory: /usr/local/www/...../plugins/WnkTaskManager --------------------------------------------------------------- Look okay? (y/n/q) [y] > y Generating README.md file... Creating file /usr/local/www/..../plugins/WnkTaskManager/README.md Wrote `/usr/local/www/..../plugins/WnkTaskManager/README.md` Generating composer.json file... Creating file /usr/local/www/..../plugins/WnkTaskManager/composer.json Wrote `/usr/local/www/..../plugins/WnkTaskManager/composer.json` Generating config/routes.php file... Creating file /usr/local/www/..../plugins/WnkTaskManager/config/routes.php Wrote `/usr/local/www/..../plugins/WnkTaskManager/config/routes.php` Generating phpunit.xml.dist file... Creating file /usr/local/www/..../plugins/WnkTaskManager/phpunit.xml.dist Wrote `/usr/local/www/..../plugins/WnkTaskManager/phpunit.xml.dist` Generating src/Controller/AppController.php file... Creating file /usr/local/www/..../plugins/WnkTaskManager/src/Controller/AppController.php Wrote `/usr/local/www/..../plugins/WnkTaskManager/src/Controller/AppController.php` Generating webroot/empty file... Creating file /usr/local/www/..../plugins/WnkTaskManager/webroot/empty Wrote `/usr/local/www/..../plugins/WnkTaskManager/webroot/empty` Modifying composer autoloader File `/usr/local/www/..../composer.json` exists Do you want to overwrite? (y/n/a/q) [n] > n Skip `/usr/local/www/..../composer.json` /usr/local/www/..../config/bootstrap.php modified --------------------------------------------------------------- Created: WnkTaskManager in /usr/local/www/..../plugins/WnkTaskManager

The folder structure looks as follows after issue the bake command:

# find plugins -type f plugins/WnkTaskManager/README.md plugins/WnkTaskManager/composer.json plugins/WnkTaskManager/config/routes.php plugins/WnkTaskManager/phpunit.xml.dist plugins/WnkTaskManager/src/Controller/AppController.php plugins/WnkTaskManager/webroot/empty # bin/cake bake controller --plugin WnkTaskManager Tasks Welcome to CakePHP v3.1.0-RC1 Console --------------------------------------------------------------- App : src Path: /usr/local/www/..../src/ PHP : 5.6.12 --------------------------------------------------------------- Baking controller class for Tasks... Creating file /usr/local/www/..../plugins/WnkTaskManager/src/Controller/TasksController.php Wrote `/usr/local/www/..../plugins/WnkTaskManager/src/Controller/TasksController.php` Baking test case for WnkTaskManager\Controller\TasksController ... Creating file /usr/local/www/..../plugins/WnkTaskManager/tests/TestCase/Controller/TasksControllerTest.php Wrote `/usr/local/www/..../plugins/WnkTaskManager/tests/TestCase/Controller/TasksControllerTest.php` Next: Model the Database Table UP: TOC