Git Product home page Git Product logo

cakephp-netbeans's Introduction

NetBeans CakePHP Plugin

This plugin provides support for CakePHP.

since 2010/07/16

Environments

  • NetBeans 8.1+
  • CakePHP 1.3.x
  • CakePHP 2.x

About CakePHP 3.x

CakePHP3 support is not provide in this plugin. Please use the following : cakephp3-netbeans

How to enable

CakePHP project is not recognized automatically from NetBeans 8.0. Please check project properties > Framework > CakePHP > enabled

What Works

  • badge icon badge icon (displayed on project folder)
  • configuration files (add app/config files to important files)
  • ignored files (hide app/tmp directory)
  • cake commands support [*1]
  • go to view, go to action
  • smart go to [v0.9.0]
  • 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 [v0.6]
  • code templates
  • format for CakePHP action [v0.6.8]
  • go to element file from view file [v0.6.9]
  • display and change debug level [v0.6.10]
  • display CakePHP version number on status bar
  • multiple app directories support [v0.6.14]
  • check default action [v0.6.15]
  • image and element code completion [v0.6.16]
  • support for PHPUnit settings and create test case [v0.6.17]
  • code generation [v0.8.1]
  • run action action
  • suport for .cake file (CakePHP 2.x)

[*1] right-click in project node > CakePHP > (Run Command | Clear Cache | Install Plugins)

Ignore tmp directory

app/tmp is ignored with default. If you would like to avoid this, please, uncheck ignore tmp directory option.

  • Tools > Options > PHP > CakePHP (on create a new project)
  • project properties > Frameworks > CakePHP (existing project)

Existing Source

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)

App Directory Path

You can set app directory path from source directory. Project properties > Framework > CakePHP > Custom directory path > app

Use multiple app directories

If you use multiple app directories:

// CakePHP 1
cakephp1.3
├─app
├─app2
├─app3
├─myapp
├─...
├─cake
├─plugins
├─vendors
├─...

// CakePHP 2
cakephp2.x
├─app
├─app2
├─app3
├─mycustom
├─...
├─lib
│  └─Cake
├─plugins
├─vendors
├─...

Use app directory as NetBeans project e.g. app1, app2, myapp, e.t.c.:

myproject(e.g. myapp)
├── nbproject
├── Config
├── Console
├── Controller
├── Lib
├── Locale
├── Model
├── Plugin
├── Test
├── Vendor
├── View
├── index.php
├── tmp
└── webroot
  1. Project properties > Framework > CakePHP
  2. app : "" (empty or ".")
  3. CakePHP Root : "../"

Please notice that Code Completion is not available. You have to add the cakephp core path to include path.

After settings, please close your project and reopen it.

.cake file support

.cake is configuration file for plugins of editors and IDEs. If your CakePHP project is not default directory structure, you should use it. e.g. In case of your app/Model directory name is app/MyModel, you have some Controller directories (Controller(default), SecondController, ThirdController), e.t.c. You can create it with Dotcake Plugin .

Supported category

  • Controller
  • Component
  • Model
  • Behavior
  • View
  • Helper

If you want to use it, please set its path to Project properties > Framework > CakePHP > .cake

Clear Cache Action

Delete each files of app/tmp/cache/* directorys.

Install Plugins Action

Settings: Tool > Option > PHP > CakePHP

  • Name : Set Plugin name. This name is Folder name.
  • Url : Set github zipball url

Note

Url is only zipball url.

Run Action: see [*1]

Plugin version numbers are not necessarily latest. Please try to check and edit them manually.

Create New CakePHP Project

You need to connect the network.

  1. File > New Project (Ctrl + Shift + N)
  2. PHP > PHP Application
  3. Set the project name
  4. Run Configuration
  5. PHP Framework > check CakePHP PHP Web Framework

Select Unzip or Unzip local file or Composer or git command. If you select Unzip, also select CakePHP version. If you want to unzip the local file, please set the option (Tools > Options > PHP > CakePHP > New Project > Local file path) 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.

Installing with composer

We can set default composer.json on Options panel. We can use --empty and app name settings when we create a project. --empty is used with bake project. If app name is empty, app directory is source directory, otherwise it is created under the source directory.

Code Completion

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

Image File Completion

$this->Html->image('[Ctrl + Space]');
// popup file and directory names in the webroot/img
$this->Html->image('subdir/[Ctrl + Space]');
// popup file and directory names in the webroot/img/subdir
// ...
$this->Html->image('/mydir/[Ctrl + Space]');
// if you want to use files or directories in the webroot directory,
// please, start with "/"

$this->Html->image('Debug[Ctrl + Space]');
$this->Html->image('DebugKit.[Ctrl + Space]');
// support for Plugin images (CakePHP 2.x)

If target file exists, image will be displayed on document window.

You can run code completion also css and script methods ($this->Html->css(), script()) like the same as image method.

$this->Html->css('[Ctrl + Space]');
// popup file and directory names in the webroot/css
$this->Html->script('subdir/[Ctrl + Space]');
// popup file and directory names in the webroot/js/subdir
$this->Html->css('/mydir/[Ctrl + Space]');
$this->Html->script('PluginName.[Ctrl + Space]');

Element File Completion

$this->element('[Ctrl + Space]');
// popup file names in the appdir/View/Elements/
$this->element('MyPlugin.[Ctrl + Space]');
// support for Plugin elements (CakePHP 2.x)

Fields Completion

This is available in the following fields. This can also complete the plugin name. Please run code completion again(i.e. [Ctrl + Space]) after "PluginName.".

  • $components
  • $helpers
  • $uses
  • $actsAs
// e.g.
public $components = array('[Ctrl + Space]');
public $components = array('DebugKit.[Ctrl + Space]');

Go To View Action

You can move from controller action to view file.

  1. Right-click at the controller action
  2. 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.

Code Templates

Available code templates : Tools > Options > Editor > Code Templates > HTML/PHP

e.g.

  • cappu -> App::uses('AppController', 'Controller');
  • chtml -> $this->Html->

This feature is also available with code completion.

Go To Action Action

Similar to Go to view action.

  1. Right-click on the view file (in editor)
  2. Navigate > Go to action

Smart Go To [v0.9.0]

You can go to specific files relate to a current file. e.g. In case of current file is Controller, you can go to existing view, model, component, helper and test. go to navigations matrix

How To Run

There are three ways.

  • Shortcuts
  • Editor Toolbar Menu
  • Context Menu

Shortcuts

Pattern : [Ctrl + Shift + G] [] (or [Ctrl + J] [])

  • [Ctrl + Shift + G] [S] : Smart Go To
  • [Ctrl + Shift + G] [M] : Go To Model
  • [Ctrl + Shift + G] [V] : Go To View
  • [Ctrl + Shift + G] [C] : Go To Controller
  • [Ctrl + Shift + G] [B] : Go To Behavior
  • [Ctrl + Shift + G] [H] : Go To Helper
  • [Ctrl + Shift + G] [P] : Go To Component
  • [Ctrl + Shift + G] [T] : Go To Test Case
  • [Ctrl + Shift + G] [F] : Go To Fixture

Of course, if you don't like these shortcuts, you are able to change them in Options (KeyMap).

Settings

project properties > Frameworks > CakePHP Please uncheck the following if you would like to go to it soon (without popup) when candidate file is only one.

  • Show the popup for one candidate item.

Note

  • Core helpers, components and behaviors are not contained in popup items.
  • Go To View / Action Action is not changed yet.
  • Automatic creation option is not available in this feature.

Format+ Action (Format for CakePHP)

This action run the following.

  1. Reformat (format settings : Tool > Option > Editor > Format)
  2. Remove indents of Document Block
  3. Change line separator to LF(Unix)

Q. Why do you add this action?

A. I add in order to follow the CakePHP Coding Standars

Hyperlink for view element files (v0.6.9)

You can go to the element file from view file.

Search the following element file directories:

  • app(app/View/Elements, app/views/elememts)
  • core(lib/cake/View/Elements, cake/views/elements)

e.g.

$this->element('sample');

Hold down Ctrl key and click on 'sample'.

If there is sample.ctp in the above directories, open the sample.ctp. Otherwise do nothing.

Display and Change debug level (v0.6.10)

You can change debug level on popup list.

When you choose the CakePHP file node, you would find the cake icon and debug level number at the lower right of the window.

If you change debug level, click the icon. Then the popup is displayed. Please, select the debug level number.

Check Default Action (v0.6.15)

Check default asset names. (e.g. css/cake.generic.css, img/cake.icon.png, ...)

Check whether favicon.ico is changed.

PHPUnit Test settings (PHPUnit Test Init Action)

Support for only CakePHP2.x

Project-right-click > CakePHP > PHPUnit Test Init

Do settings for doing PHPUnit Test with NetBeans.

Create following files:

  • nbproject/NetBeansSuite.php
  • nbproject/phpunit.bat or phpunit.sh
  • app/webroot/bootstrap_phpunit.php

And set PHPUnit settings of Project properties:

  • bootstrap
  • custome script

If you run this action, you can test using fixture with NetBeans.

bootstrap and NetBeansSuite Sources

https://gist.github.com/2055307 (nojimage)

Code Generation

How To Run

Alt + Insert or Right-click on editor, select Insert Code.

Generate uses, helpers, components and actsAs fields

Dialog is displayed when you run Insert Code action. Please select what you want to use. And code like followings are inserted.

$helpers = array('Html', ..., 'PluignName.SomeHelper');
$componens = array('Session', ..., 'MyComponent');
$uses = array('Post');
$actsAs = array('Tree', ..., 'PluignName.SomeBehavior');

You have to add settings for each classes by yourself if you need it.

Generate validations

This provides support for only Core validations.(e.g. notEmpty, isUnique, e.t.c) At first, you have to write the following before you run this feature.

public $validate = array(
    'fieldName' => array(
        // please set caret to here
    ),
);

Please move caret to place which you want to insert, and run Insert Code action. Then, code like followings will be inserted:

// template
'validationName' => array(
    'rule' => 'validationName',
    'message' => 'validationNamemessage'
},
// template : has arguments(are not initialized)
'validationName' => array(
    'rule' => array('validationName', validationName_arg1, validationName_arg2),
    'message' => 'validationNamemessage'
},

Since message is focused, you can change it to your message. Please push Enter key after you change it. And you can move to next message. If you want to move to previous message, please push Shift + Tab.

Please see also #12

Run Action Action

You can run the action for controller.

  • move the current caret position to within brace of action method.
  • right-click > CakePHP > Run Action or Editor Toolbar > Cake icon > Run Action
  • open the browser
public function index() {
    // move the caret here
}

Note

Currently, this is available for the simple situation.

Please also see the following: #16

CMS Support

baserCMS3

baserCMS is an open source CMS and powered by CakePHP Framework.

Features

  • Setting action for Vagrant
  • Pallete
  • Run PhpMyAdmin and PhpPgAdmin action
  • Copy existing theme action
  • New Project Wizard

References

How To Run

  • download NBM file or manually create NBM file
  • manually install NBM file

How To Develop

  • 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

References

Trableshooting

Can't get CakePHP verison numbers in the New Project Wizard

  • Please try checking whether your machine is connected to internet
  • Your request count via GitHub API may be over the limit. Please try waiting for one hour.

Donation

License

Common Development and Distribution License (CDDL) v1.0 and GNU General Public License (GPL) v2

cakephp-netbeans's People

Contributors

evilbloodydemon avatar junichi11 avatar tmysik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cakephp-netbeans's Issues

Can't install plugin after Netbeans auto update (7.3) - implementation version error

After launching nb it showed me some updates. On the updates list was CakePHP plugin listed with some components which needed updating as well. After updating IDE and restarting CakePHP showed me this message:
Warning - could not install some modules: PHP CakePHP Framework - The module PHP Project was requested in implementation version "201302132200" but only "201303242200" was found.

Plugin version: 0.8.5

Plugin Command error

Hi, Amazing plugin, just note.

All the plugins installed doesn't work in the cakephp project command interface.

*plugin's installed in the app/plugin folder.

teste/app/Console/cake.php Bdd.bdd.init
Error: Shell class Bdd.initShell could not be found.
#0 /Users/guilhermesantos/NetBeansProjects/teste/lib/Cake/Console/ShellDispatcher.php(190): ShellDispatcher->_getShell('Bdd.bdd.init')
#1 /Users/guilhermesantos/NetBeansProjects/teste/lib/Cake/Console/ShellDispatcher.php(68): ShellDispatcher->dispatch()
#2 /Users/guilhermesantos/NetBeansProjects/teste/app/Console/cake.php(37): ShellDispatcher::run(Array)
#3 {main}

Done.

All plugins crash after adding

I tried to add the plugin via NetBeans Plugins interface.

Aftrer restarting NetBeans, I get a lot of "Activation failed: Not all requested modules can be enabled:" errors for virtually all plugins.

So I disabled them all.

Uninstalled CakePHP plugin, tried activating others and all activations fail.

Now I'm reinstalling NetBeans. :D

Am I doing something wrong?

Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.7.0_13; Java HotSpot(TM) Client VM 23.7-b01
System: Windows 7 version 6.1 running on x86; Cp1250; en_US (nb)

RUN COMMAND Failed

1 right click on my project and choose Run command ...
2 No commande available
3 i look at the IDE log where i find a problem in the xml file that was generated
4 I just look at the xml file that was generated ans i find Failed loading c:/wamp/bin/php/php5.3.26/zend_ext/php_xdebug-2.2.0-5.4-vc9.dll

I use wamp on a windows machine at my work where i've got this message. At my home i use a mac and no problem (after i set date_default_timezone_set('GMT'); as see with you a next time)

I use your last plugin version (0.9.1), cakephp 2.3.8 and netbeans 7.3 in french language and the same on my mac

[Discuss] Will a global install of Cake work for the plugin?

My setup here is that I have Cake checked out on my system globally into /usr/local/Cellar/CakePHP. Our projects tend to not include the lib folder and instead use the system-wide version, with the same on our production.

Is it possible to use a relative path as per the documentation? This would make my relative path this ../../../../usr/local/Cellar/CakePHP/lib/ but this doesn't appear to work.

Cake in /usr/local/Cellar/CakePHP
Project in /Users/david/Sites/DigitalServicesAPI for example

Will there be any support for using system-wide Cake, possibly using the systems PATH? Or is there a trick to the relative path?

Display of debug level isn't changed

What I did

  • open cakephp project
  • change debug level with status bar
  • debug level is changed but display isn't changed

environment

  • NetBeans7.3
  • plugin version is 0.8.5
  • CakePHP 2.x

Run action

Run action on current caret position.

webroot as "shortcut"

From plugin portal comment:


Would it be possible to add the app/webroot folder as a shortcut like you have with the Controller, Model, etc... ?

I do a lot of work with CSS/js files that are stored in there.


Autocompleting elements doesn't work

Hello!

I have setup a new CakePHP 1.3.17 project with the latest version of the plugin (0.9.1, downloaded from http://plugins.netbeans.org/plugin/44579), but autocompleting elements doesn't seem to work on my environment, as you can see on the attached image.

autocomplete_element

I'm running Netbeans 7.3 with the latest updates installed. Other plugins features works nicely, including going to the element file with Ctrl + click.

I'd be glad to help you with any additional debug information.

Thanks in advance.

CakePHP version is not displayed

What I did

  • open CakePHP project
  • open other php project (not CakePHP)
  • select other php project
  • select CakePHP project
  • version is not displayed but debug level is displayed

environment

  • NetBeans 7.3
  • cakephp-netbeans plugin dev version

Hyperlink navigation doesn't work

What I did

// in view file

$this->element('Foo/element');

Hyperlink navigation doesn't work when I use element for sub directory.

code completion not working for NetBeans PHP IDE 7.3

Having built the CakePhp starter blog tutorial within NetBeans using the latest version of this plugin, there is no code completion available for the Post class (extends AppModel) within the PostsController class. There is a CakePhp badge on project icon.

tmp Folder Not Automatically Created

When I create a new CakePHP project using a fresh install of NetBeans 7.3 with PHP, the tmp folder is not automatically created.

Caution: It will take a bit of work to reproduce the problem.

Environment (inside a brand new virtual machine running on Virtual PC):

  • Windows 7 Professional SP1 x86, EN-US
  • NetBeans 7.3 with PHP
  • UniServer 8.8.0 with Xdebug enabled
  • MySQL Workbench
  • IE 10

Steps to Reproduce:

  1. Start MySQL Workbench
  2. Create a new database named "cake"
  3. Run the following SQL on the cake database. The SQL is taken from the CakePHP Blog Tutorial at http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html:

/* First, create our posts table: */
CREATE TABLE posts (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(50),
body TEXT,
created DATETIME DEFAULT NULL,
modified DATETIME DEFAULT NULL
);

/* Then insert some posts for testing: */
INSERT INTO posts (title,body,created)
VALUES ('The title', 'This is the post body.', NOW());
INSERT INTO posts (title,body,created)
VALUES ('A title once again', 'And the post body follows.', NOW());
INSERT INTO posts (title,body,created)
VALUES ('Title strikes back', 'This is really exciting! Not.', NOW());

  1. Start NetBeans.
  2. File | New Project
  3. Click on PHP
  4. Click on PHP Application
  5. Click Next
  6. Click Next
  7. Run as a "Local Web Site (running on local web server)"
  8. Tick "Copy files from Sources Folder to another location"
  9. Type in the following Copy to Folder: "C:\Uniserver\www\cakeTest"
  10. Click Next
  11. Check "CakePHP PHP Web Framework"
  12. Click "Unzipping"
  13. Check "Create database.php"
  14. For the datasource, type in "MySQL"
  15. Leave "persistent" unchecked.
  16. For host, enter localhost
  17. Enter your login information
  18. Enter "cake" as the database.
  19. Click Finish
  20. Press F6

Expected Result:

The CakePHP welcome page with no errors.

Actual Result:

Stacks of Xdebug orange boxes.

Workaround:

Go to C:\UniServer\www[project name]\app and create the following folders:

\tmp
\tmp\cache
\tmp\cache\models
\tmp\cache\persistent

Refresh the page

Update existing cakePHP Project to later Version

Hi,

I started some weeks ago with my first cakePHP project using netbeans and your plugin. So far everything works quite nicely. Today I realized the version of cakePHP I am using is 2.2.4. I would like to update to 2.2.7 but it seems like the plugin does not offer an option to do this. Is it safe to download the sources and extract them in the same folder? Wouldn't this be a good option for the plugin?

Best Regards
Christian

Hi, junichi11, create plugin "Framework Laravel"

Junichi11 Hello, sorry to write here, but I found another place to contact.
I write because it would be very good to make a plug for the new Framework Laravel, which is having a lot of growth and has a lot of CakePHP, CodeIgniter, FuelPHP, Zend, etc. ..

Greetings and would be great if you can create.
And if you do not know the framework I invite you to look at it because this stomping.
regards

Only for new projects?

Hi, Thanks for this plugin!

I have a question, this plugin only works for new projects?

No icons or new menues in my old cakephp projects.

Code Generator

For example, generate the followings with GUI (Alt + Insert):

  • public $components = array('Session', 'DebugKit.Toolbar', 'MyCustom');
  • public $helpers = array('Session', 'Html', 'Form', 'MyPlugin.MyHelper');
  • public $uses = array('Post', 'Member', 'Comment');

I'll try to implement on NetBeans7.3+.

Format for CakePHP doesn't follow CakePHP Coding Standards

Hey, not sure if you are maintaining the actual plugin or not, but I found an issue. If not, can you close this issue and I'll raise it with the maintainer 👍

I have both the CakePHP plugin and also the CakePHP CodeSniffers profile, and they do not produce the same results.

The coding standards can be found here, http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html

The primary thing that I noticed is that the control structures, such as if () { // hi } are not formatted with the recommended spacing.

The CakePHP CodeSniffer is here, https://github.com/cakephp/cakephp-codesniffer and I keep a Gist on setting it up with Netbeans that you might find handy. https://gist.github.com/4538113

problem copying file from source folder to web folder

I was running netbean 7.3 and cake framework plugin as well up to yesterday. now the problem is:
when I create a new php project which use cake framework, then I choose to copy the source folder to an other location.
every thing works fine but when run the website, I get the error :

Warning: cake_core cache was unable to write 'cake_dev_en-us' to File cache in C:\xampp\htdocs\opentest\lib\Cake\Cache\Cache.php on line 309

Warning: C:\xampp\htdocs\opentest\app\tmp\cache\persistent\ is not writable in C:\xampp\htdocs\opentest\lib\Cake\Cache\Engine\FileEngine.php on line 336

Warning: C:\xampp\htdocs\opentest\app\tmp\cache\models\ is not writable in C:\xampp\htdocs\opentest\lib\Cake\Cache\Engine\FileEngine.php on line 336

Warning (512): C:\xampp\htdocs\opentest\app\tmp\cache\ is not writable [CORE\Cake\Cache\Engine\FileEngine.php, line 336]

Warning (512): cake_core cache was unable to write 'cake_en-us' to File cache [CORE\Cake\Cache\Cache.php, line 309]

Warning (512): cake_core cache was unable to write 'file_map' to File cache [CORE\Cake\Cache\Cache.php, line 309]

I found that the netbeans doesn't copy the tmp folder, and the tmp folder is hiden from the source directory. when I manually copy the tmp folder to the web location, it works again.
so any one please help me to solve that.
I tried to reinstall the plug in and even reinstall the netbean too but the bug is still there.
thanks.

autocomplate bug

No Bug I was Wrong
Thanks " NetBeans cakephp plugin team " :)

Add Code Completion for AppController fields

Currently, Code Completion for helpers, components, e.t.c. fields is available only concrete controller.
e.g.
If we set helpers to AppController, code completion for helper is not available.

class AppController extends Controller {
    public $helpers = array('Foo', 'Bar'); // these helpers are not available in view
}
class PostsController extends Controller {
    public $helpers = array('MyHtml', 'MySession'); // these helpers are available in view
}

Code Templates

Add code templates as the followings:

  • $this->request->data(); :: rdata or crdata
  • $this->Html->link(); :: link or clink
  • Configure::read(); :: confr or cconfr
  • Configure::write('',''); :: confw or cconfw
  • more...

Add plugin not working

I can't add plugin urls at the plugin list.

Github URL is changed from https://github.com/:user/:repo/zipball/master to https://github.com/:user/:repo/archive/master.zip .

Helper alias

Hi there,
thanks for this great netbeans plugin!!!!

A special request: is there a way to have autocomplete for helper alias in view files?

class AppController extends Controller {

public $helpers = array(
            'Html' => array(
                    'className' => 'CustomHtml',
[..]

As general question: is there a way to "inject" specific property autocomplete feature in views? (without touch View class in lib directory of course)

Thanks for time

Run command / There is no command available

I use Netbeans 7,3, cakephp 2,3,4 and my OS is MAC OSX.
The project struture is :

  • app
  • lib/Cake
  • plugins
  • vendors

In project/properties under netbeans i give the cakephp directory like /Volumes/web/project_name/lib/ or /Volumes/web/project_name/lib/Cake/ and nothing change

When i check use relative path the menu disappear.

With terminal i can use the cakephp command, but it is useful with netbeans, so what the solution ?

There is no command available

Hi.
i cant run command like 'bake all'.
when opening cakephp->run command, displayed "" in Matching Tasks.
i use NetBeans 7.3 on Mac OS X Mountain Lion.
Thank you.

CakePHP3 Early Support

Maybe, I think that I can provide the CakePHP3 plugin as the same plugin with CakePHP1 &2.

  • Go To View
  • Go To Action
  • Run Command
  • Code Generator
  • New Project Wizard

Go To View

Perhaps, It will work fine.

Code Completion

View and Controller classes PHP doc have to be changed like the following:

View class

/**
 * ... 
 * @property      Helper\CacheHelper $Cache
 * @property      Helper\FormHelper $Form
 * @property      Helper\HtmlHelper $Html
 * @property      Helper\NumberHelper $Number
 * @property      Helper\PaginatorHelper $Paginator
 * @property      Helper\RssHelper $Rss
 * @property      Helper\SessionHelper $Session
 * @property      Helper\TextHelper $Text
 * @property      Helper\TimeHelper $Time
 * @property      Helper\ViewBlock $Blocks
 */

Controller class

/**
 * ... 
 * @property      Component\AclComponent $Acl
 * @property      Component\AuthComponent $Auth
 * @property      Component\CookieComponent $Cookie
 * @property      Component\EmailComponent $Email
 * @property      Component\PaginatorComponent $Paginator
 * @property      Component\RequestHandlerComponent $RequestHandler
 * @property      Component\SecurityComponent $Security
 * @property      Component\SessionComponent $Session
 */

Run Command

Currently, It seems to work fine.

These results need some changes for source code. i.e. Current plugin doesn't work with CakePHP 3.x.

java.lang.NullPointerException

environment

Product Version = NetBeans IDE 7.3 (Build 201302132200) (#93e87decaddf)
Operating System = Linux version 3.2.0-38-generic-pae running on i386

process

  • open PHP project
  • delete PHP project ( not only project but also all files and directories)
  • install plugin

LOG

java.lang.NullPointerException
at org.cakephp.netbeans.util.CakeVersion.getCakePhpVersion(CakeVersion.java:151)
at org.cakephp.netbeans.util.CakeVersion.getCakePhpVersionSplit(CakeVersion.java:178)
at org.cakephp.netbeans.util.CakeVersion.(CakeVersion.java:64)
at org.cakephp.netbeans.util.CakeVersion.getInstance(CakeVersion.java:112)
at org.cakephp.netbeans.module.CakePhpModuleFactory.create(CakePhpModuleFactory.java:83)
at org.cakephp.netbeans.module.CakePhpModule.forPhpModule(CakePhpModule.java:324)
at org.cakephp.netbeans.CakePhpFrameworkProvider.isInPhpModule(CakePhpFrameworkProvider.java:105)
at org.cakephp.netbeans.util.CakePhpUtils.isCakePHP(CakePhpUtils.java:67)
at org.cakephp.netbeans.ui.logicalview.MVCNodeFactory.createNodes(MVCNodeFactory.java:75)
at org.netbeans.spi.project.ui.support.NodeFactorySupport$DelegateChildren.resultChanged(NodeFactorySupport.java:315)
[catch] at org.openide.util.lookup.AbstractLookup$NotifyListeners.run(AbstractLookup.java:537)
at org.openide.loaders.FolderLookup$Dispatch.run(FolderLookup.java:314)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)

Multiple app directories support

This plugin doesn't support for multiple app directories.
e.g.

myproject
├── README.md
├── app
├── app1
├── app2
├── some-app
├── build.properties
├── build.xml
├── index.php
├── lib
├── plugins
└── vendors

I would like to support for it.

Create new project with local zip

the plugin require internet connection when creating a new cakephp project.
so when I create a new project at the place without internet connection, it's not gonna work.
Could you give a option for choosing the existing downloaded cakephp packet to use when the internet is not available.

Improve navigation feature

Now, Go to view can move only view file for action name. If user use render method, wrong view file is opened. So I would like to improve this feature. And I would like to add more "go to" feature. e.g. ClassName <=> ClassNameTest. If multiple items are found, plugin will be displayed a popup list.

Proposal from user

  • Model -> Controller
  • Model -> Behavior
  • Model -> Fixture
  • Controller -> View (method name, $view, render())
  • Contorller -> Model
  • Controller -> Component, Helper
  • View -> Controller
  • View -> View (View::extend())
  • View -> Element (If use hyperlink navigation, can jump to the element file now)
  • TestCase -> Fixture

@nojimage Thanks a lot!

Usage

  • [Ctrl + Shift + G ] [T] Go To TestCase
  • [Ctrl + Shift + G ] [F] Fixture
  • [Ctrl + Shift + G ] [M] Model
  • [Ctrl + Shift + G ] [C] Controller
  • [Ctrl + Shift + G ] [V] View
  • [Ctrl + Shift + G ] [H] Helper
  • [Ctrl + Shift + G ] [P] Component
  • [Ctrl + Shift + G ] [B] Behavior
  • [Ctrl + Shift + G ] [S] Smart Go To

cakephp-netbeans-smart-go-to

Throw exception when run code completion

Throw exception on the view files.
This issue doesn't occur on NetBeans7.2.

I need to specify the FileObject.

We can run the code completion only View file, otherwise can't run...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.