Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/natanfelles/codeigniter-phpstorm
PhpStorm Code Completion for CodeIgniter 3
https://github.com/natanfelles/codeigniter-phpstorm
code code-completion codeigniter completion hmvc phpstorm
Last synced: 9 days ago
JSON representation
PhpStorm Code Completion for CodeIgniter 3
- Host: GitHub
- URL: https://github.com/natanfelles/codeigniter-phpstorm
- Owner: natanfelles
- Created: 2016-03-20T21:39:33.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-24T20:10:55.000Z (about 5 years ago)
- Last Synced: 2025-01-09T09:17:48.976Z (17 days ago)
- Topics: code, code-completion, codeigniter, completion, hmvc, phpstorm
- Language: PHP
- Homepage: https://natanfelles.github.io/blog/codeigniter-code-completion-phpstorm.html
- Size: 284 KB
- Stars: 204
- Watchers: 34
- Forks: 101
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - natanfelles/codeigniter-phpstorm - PhpStorm Code Completion for CodeIgniter 3 (PHP)
README
# 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:
```php
/**
* 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:
```php
/**
* @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:
```php
$cart->add(5);
```### Usage in Views
If you want load CI_Controller or MX_Controller in a view, add a doc block as follow:
```php
/**
* @var CI_Controller $this
*/
echo $this->uri->segment(1);
````### Preview:
![Image of Code Completion](https://raw.githubusercontent.com/natanfelles/codeigniter-phpstorm/master/codeigniter-phpstorm.png)