I am trying to bake models, controllers and views for my plugin in my app called: admin. I am using windows 7. Bake works when baking an app and within the app.
This is what I am doing:
This is the folder my plugin resides in: 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');
Its still not working. If someone knows what I am doing wrong, please help. thanks. Louis
1) Bake your plugin:
cake bake plugin PluginNameInCamelCase
2) Bake everything else:
cake bake controller ControllerName --plugin PluginNameInCamelCase
See this page for further documentation in baking plugins: Creating Your Own Plugins with CakePHP
Although above code works but this code provide more useful options.
Step 1: Create Plugin
cake bake plugin PluginNameInCamelCase
Step 2: Create Model
cake bake model plugin --PluginNameInCamelCase`
It will show list of available models, select you want to bake like user model, news model etc
Step 3: Create Controller
cake bake controller plugin -- PluginNameInCamelCase
It will show list of available controllers, select you want to bake like user controller, news controller etc
Step 4: create finally view files for your plugin
cake bake view plugin --PluginNameInCamelCase
It will show list of available controllers for which you want to make view files, select and done!
Read more
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With