This plugin provides support for CakePHP.
*** KEEP THIS FILE UPDATED OR REMOVE IT COMPLETELY ***
- 2010/07/16
- 2012/09/30 last update
- NetBeans IDE 7.2
- CakePHP 1.3.x
- CakePHP 2.x
- badge icon (displayed on project folder)
- configuration files (add app/config files to important files)
- display file path in Toolbar (If you don't want to display, uncheck Display > Toolbar > View.)
- ignored files (hide app/tmp directory)
- cake commands support [*1]
- go to view, go to action
- clear cache action [*1]
- install plugins action (from zip file URL)[*1]
- template files (ctp, helper, component, behavior, shell, task)
- create new CakePHP projects from new project option
- code completion support [New:v0.6]
[*1] right-click in project node > CakePHP > (Run Command | Clear Cache | Install Plugins)
Your NetBeans Project needs to have the following trees.
CakePHP 1.3.x
myproject
├─nbproject
├─app
├─cake
├─plugins
├─vendors
├─...
CakePHP 2.x
myproject
├─nbproject
├─app
├─lib
│ └─Cake
├─plugins
├─vendors
├─...
NewProject (Ctrl + Shift + N) > PHP > PHP Application with Existing Source Please select your cakephp dir(e.g. /home/NetBeansProjects/myproject)
This plugin support only for "app" .
Perhaps, can't use a lot of features if you use another name.
Delete each files of app/tmp/cache/* directorys.
Settings: Tool > Option > PHP > CakePHP
- Name : Set Plugin name. This name is Folder name.
- Url : Set github zipball url
Url is only zipball url.
Run Action: see [*1]
You need to connect the network.
- File > New Project (
Ctrl + Shift + N
) - PHP > PHP Application
- Set the project name
- Run Configuration
- PHP Framework > check CakePHP PHP Web Framework
Select Unzip
or git command
.
If you select Unzip
, also select CakePHP version.
If you want to create a database.php file, please, check the Create database.php.
Also set the following automatically.
- change permission of app/tmp directory (777)
- change Security.salt and Security.cipherSeed values
create a database, you can immediately start development in a local environment.
Support for core components and helpers (default). Also support for classes in $uses, $components, $helpers.(also contain the alias)
// e.g.
public $uses('Comment', 'Member', 'User');
// $this->Comm [Ctrl + Space] => $this->Comment [Ctrl + Space]
public $components('Search.Prg', 'Foo');
// $this->P [Ctrl + Space] => $this->Prg-> [Ctrl + Space] => display methods and fields
public $helpers('Session', 'Html' => array('className' => 'MyHtml'));
// $this->Html-> [Ctrl + Space] => display MyHtmlHelper class methods and fields
You can move from controller action to view file.
- Right-click at the controller action
- Navigate > Go to view
e.g.
class MainController extends AppController{
// ... something
public function index() {
// Right-click or shortcut here
}
}
If you use shortcut, register with Keymap.
When the view file doesn't exist, create the empty view file automatically if set as follows.
Check Auto create a view file when go to view action is run
at Right-click on project node > property > Framework > CakePHP
If you use the theme, set $theme to controller field.
Similar to Go to view action.
- Right-click on the view file (in editor)
- Navigate > Go to action
This action run the following.
- Reformat (format settings : Tool > Option > Editor > Format)
- Remove indents of Document Block
- Change line separator to LF(Unix)
Q. Why do you add this action? A. I add in order to follow the CakePHP Coding Standars
- download NBM file or manually create NBM file
- manually install NBM file
- read this page [1] for the general overview but notice that current sources need to be used, then
- checkout NB sources via Mercurial (preferred, easy updates)[2] or download archive with latest NB sources from NB download site [3]
- Tools > NetBeans Platforms - add new platform "NetBeans IDE Dev" that points to the cloned/downloaded sources
- if not done yet, open this module in NetBeans
- Run
Common Development and Distribution License (CDDL) v1.0 and GNU General Public License (GPL) v2