CakePHP 2.2.2 bake for plugin

I am trying to bake models, controllers and views for my plugin in my application: admin. I use Windows 7. Bake works when baking an application and in the application.

This is what I do:

  • cd c: \ wamp \ www \ propharm \ app (also tried without \ app)
  • version for plugins for baking cakes

This is the folder where my plugin is located: C: \ wamp \ www \ propharm \ app \ Plugin

I get this in response from the console.

Create the directory structure, AppModel and AppController classes for a new plugin. Can create plugins in any of your bootstrapped plugin paths. Usage: cake bake plugin [-h] [-v] [-q] [<name>] Options: --help, -h Display this help. --verbose, -v Enable verbose output. --quiet, -q Enable quiet output. Arguments: name CamelCased name of the plugin to create. (optional) 

I tried this: in bootrap.php

 CakePlugin::load('Admin'); 

It still does not work. If someone knows what I'm doing wrong, please help. Thank you Louis

+4
source share
2 answers

1) Bake your plugin:

 cake bake plugin PluginNameInCamelCase 

2) Bake everything else:

 cake bake controller ControllerName --plugin PluginNameInCamelCase 

See this page for more documentation on baking plugins: Creating your own plugins using CakePHP

+11
source

Although the code above works, this code provides more useful options.

Step 1: Create a Plugin

cake baking plugin PluginNameInCamelCase

Step 2: Create a Model

cake baking plugin --PluginNameInCamelCase`

It will show a list of available models, select which you want to bake as a user model, news model, etc.

Step 3: Create a Controller

baking controller plugin - PluginNameInCamelCase

It will show a list of available controllers, select which you want to bake as a user controller, news controller, etc.

Step 4: create final review files for your plugin

cake baking plugin --PluginNameInCamelCase

It will show a list of available controllers for which you want to make viewing files, select and do!

More details

+1
source

Source: https://habr.com/ru/post/1432467/


All Articles