2

Been trying to get Zend Studio to auto complete CodeIgniter. Stumbled upon this stackoverflow answer though with no luck. I have added system/libraries to the PHP Include Path, though when I open a controller and try to get auto complete to work ($this->db) nothing appears.

I've searched google for quiet a bit and the only answer I could find was the one I attached.

If someone tried that before, maybe he could show me where I'm mistaken, Thanks in advance.

Community
  • 1
  • 1

1 Answers1

0

One way to get the intellisense working is to create a dummy CI controller like -

<?php
class CI_Controller {
/**
 *
 * @var CI_DB_active_record
 */
public $db;

/**
 *
 * @var CI_Loader
 */
public $load;

/**
 *
 * @var CI_Output
 */
public $output;

/**
 *
 * @var CI_Email
 */
public $email;

/**
 *
 * @var CI_Session
 */
public $session;

/**
 *
 * @var CI_Config
 */
public $config;

/**
 *
 * @var CI_Benchmark
 */
public $benchmark;

/**
 *
 * @var CI_Calendar
 */
public $calendar;

/**
 *
 * @var CI_Cart
 */
public $cart;

/**
 *
 * @var CI_Encrypt
 */
public $encrypt;

/**
 *
 * @var CI_Upload
 */
public $upload;

/**
 *
 * @var CI_Form_validation
 */
public $form_validation;

/**
 *
 * @var CI_FTP
 */
public $ftp;

/**
 *
 * @var CI_Table
 */
public $table;

/**
 *
 * @var CI_Image_lib
 */
public $image_lib;

/**
 *
 * @var CI_Input
 */
public $input;

/**
 *
 * @var CI_Language
 */
public $lang;

/**
 *
 * @var CI_Pagination
 */
public $pagination;

/**
 *
 * @var CI_Trackback
 */
public $trackback;

/**
 *
 * @var CI_Parser
 */
public $parser;

/**
 *
 * @var CI_Typography
 */
public $typography;

/**
 *
 * @var CI_Unit_test
 */
public $unit;

/**
 *
 * @var CI_URI
 */
public $uri;

/**
 *
 * @var CI_User_agent
 */
public $agent;

/**
 *
 * @var CI_Xmlrpcs
 */
public $xmlrpcs;

/**
 *
 * @var CI_Xmlrpc
 */
public $xmlrpc;

/**
 *
 * @var CI_Zip
 */
public $zip;

    }

Create another class to get instance of it -

<?php
/**
* 
* Enter description here ...
* @return CI_Controller
*/
function get_instance()
{

}

Name them something like Dummy_CIController.php and Dummy_Factory.php and place them inside the /applications/libraries folder.

Since you are also going to need intellisense for models, create Dummy_CIModel.php that has everything which Dummy_CIController.php has except it extends CI_Model.

You may later want to do some clean up by removing db intellisense from Controller as you wouldn't want to call database directly from the controller.

Mukus
  • 4,870
  • 2
  • 43
  • 56