Stars: 202
Forks: 121
Pull Requests: 0
Issues: 18
Watchers: 34
Last Updated: 2020-01-24 20:10:55
PhpStorm Code Completion for CodeIgniter 3
License:
Languages: PHP
https://natanfelles.github.io/blog/codeigniter-code-completion-phpstorm.html
Working perfectly with CodeIgniter 3.*
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);
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);