Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter & PhpStorm - Autocomplete plugin?
#1

Hi there,

Just wondering if anyone knows of a CI plugin for PHPStorm that supports autocomplete etc for CI3?

Many thanks,

Tom
Reply
#2

He Tom,

I'm using PhpStorms and haven't found one yet.

There is a trick to give you some sort of autocomplete feel using the following header code in you're controllers / models.
Code:
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Benchmark $benchmark
* @property CI_Calendar $calendar
* @property CI_Cart $cart
* @property CI_Config $config
* @property CI_Controller $controller
* @property CI_Email $email
* @property CI_Encrypt $encrypt
* @property CI_Exceptions $exceptions
* @property CI_Form_validation $form_validation
* @property CI_Ftp $ftp
* @property CI_Hooks $hooks
* @property CI_Image_lib $image_lib
* @property CI_Input $input
* @property CI_Language $language
* @property CI_Loader $load
* @property CI_Log $log
* @property CI_Model $model
* @property CI_Output $output
* @property CI_Pagination $pagination
* @property CI_Parser $parser
* @property CI_Profiler $profiler
* @property CI_Router $router
* @property CI_Session $session
* @property CI_Sha1 $sha1
* @property CI_Table $table
* @property CI_Trackback $trackback
* @property CI_Typography $typography
* @property CI_Unit_test $unit_test
* @property CI_Upload $upload
* @property CI_URI $uri
* @property CI_User_agent $user_agent
* @property CI_Validation $validation
* @property CI_Xmlrpc $xmlrpc
* @property CI_Xmlrpcs $xmlrpcs
* @property CI_Zip $zip
*
* Add additional libraries you wish
* to use in your controllers here
*
* @property Accounts_model $Accounts_model
*
*/

Mind that this is voor CI 2.x.x. If you're using CI 3 you maybe have to change some class names.

Hope this helps.

Roger
Reply
#3

when i was using the trial version of php storm i created a file in application/config called: autocomplete.php


in it, yes i had the above but you can also add class declarations in this file as well, so after your property comments as above put stuff like this:

PHP Code:
class CI_Controller {};
class 
MY_Controller extends CI_Controller {};
class 
Welcome extends MY_Controller {};
class 
Admin_Controller extends MY_Controller {};
class 
CI_Model {};
class 
MY_Model extends CI_Model {}; 

it's works pretty good. Is it perfect? no, but like i said, works pretty good.
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
Reply
#4

Hey Guys,

Ok thanks very much for your suggestions -- looks like some good work arounds, I will give them a go, hopefully now that CI is a bit more active they might add official support.

How do you find PHPStorm in general?
Reply
#5

I love Php Storm. My Preferred IDE, however i am as broke as a 3 dollar bill so cannot afford it.
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB