0
votes

I new to cakephp, i have created plugin of theme named Amuk

enter image description here

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.

1
If you're using the latest version of Cake, you shouldn't be tagging this question with 2.0 and 2.3. It's on 3.5 now.Greg Schmidt

1 Answers

0
votes

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.