Giter VIP home page Giter VIP logo

codeigniter-phpstorm's Introduction

PhpStorm Code Completion to CodeIgniter + HMVC

Working perfectly with CodeIgniter 3.*

How to use it:

  1. Drop the phpstorm.php file into your CI project root then PhpStorm will index it.
  2. Go to system/core/ folder.
  3. Select Controller.php and Model.php files, right click and set Mark as Plain Text.

HMVC Support

If you are using the Modular HMVC, mark as Plain Text the Controller.php file in the MX folder.

You need to add the @property tag in the class doc block:

/**
 * Class Cart
 * @property Cart $cart Cart module
 */
class Cart extends MX_Controller {

	/**
	 * Add product to cart
	 * @param int $id Product id
	 */
	public function add($id = 0)
	{
		// Do it...
	}
}

To load modules in other places do like it:

/**
 * @var Cart $cart This will provide Code Completion in the $cart variable
 */
$cart = Modules::load('cart');

Use Ctrl + Q in $cart to load documentation or help with available functions:

$cart->add(5);

Usage in Views

If you want load CI_Controller or MX_Controller in a view, add a doc block as follow:

/**
 * @var CI_Controller $this
 */
echo $this->uri->segment(1);

Preview:

Image of Code Completion

codeigniter-phpstorm's People

Contributors

natanfelles avatar

Watchers

 avatar

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.