Issue
I new to cakephp, i have created plugin of theme named Amuk
Now i want to do my application coding, i have doubt regarding where i have to put application controller, in the main src folder or in the /plugins/Amuk/src/Controller/. Second doubt is where i will put my view file. Here i have created default.ctp inside Layout folder, but where shouls i put my other views that are to be rendered inside this default view. Please help to clear my doubts or give up some usefull links to start with. I am using Latest Version of Cakephp.
Solution
The rules for naming files in a plugin is the same as for the main application. Your controllers go in the Controller folder, e.g. Controller/ThingsController.php
. Your templates go in a folder under Templates, named the same as the controller, so Template/Things/index.ctp
for example. See Conventions and Folder Structure in the manual for more complete details.
But the easiest thing to do might be to use the bake tool (e.g. bin/cake bake -p Amuk
) to have it generate skeleton code for you. It will put all the files in the right places, correctly named, with correct namespaces, generate inputs in the edit page based on fields it finds in the database, lots of useful stuff. Anything it generates that you don't need, just delete. See Code Generation with Bake for more details on this.
Answered By - Greg Schmidt Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.