Hi friends, as you know CakePHP 3 has become strong PHP framework and famous among developers. So, I came here with an interesting article that will help most of the developers with features provided by CakePHP 3 to ease their work while working on projects. basic structures – Model, View and Controller files can be created without spending lots of time. We can create not only files but also basic required functions by few command lines command for any module within few minutes.
CakePHP 3 follows MVC (Model, View and Controller) modal as others do. It provides a command through which we can create basic MVC structures (means required files and folders) automatically. We will read about those commands below in more detail. Here, I took an example that we need to create the basic files and folders for carts table.
Please ensure that you are in your root directory of your projects before running these commands.
Create model files for carts
bin/cake bake model carts
This command creates entity file in src/Entity/Cart.php
This command creates entity file in src/Table/CartsTable.php
Create controller files for carts
bin/cake bake controller carts
This command creates controller file in src/Controller/CartsController.php
Create template files for carts
bin/cake bake template carts
This command creates templates files like add.php, edit.php, view.php, index.php
Create all necessary files for carts by using single command
bin/cake bake all carts
This command creates all basic files on its own for the carts module
Create only index file in template/carts
bin/cake bake template carts index
This command creates folder in src/template/Carts/index.php
Creating file in admin folder
bin/cake bake controller carts –prefix admin
This command creates folder in src/template/Admin/Controller/Cartscontroller.php
Hope above mentioned command lines instructions will help to save your most of time.
Also check out– http://learnwill.net/share-files-through-google-drive-link/