8

我正在使用 Eclipse PDT 使用 PHP Code Igniter 进行编码。我想让自动完成工作。有谁知道我怎么能做到这一点?我找到了一些在线教程,但没有成功。

4

3 回答 3

16

你可以试试这个方法

  1. 选择“项目”->“属性”或“窗口”->“首选项”->“PHP”(全局使用)
  2. 选择“PHP 包含路径”</li>
  3. 单击“添加外部源文件夹”并指向下面的文件
  4. 重启日食

指向下面这个文件的路径

ciautocomplete.php

<?php

/**
* @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
*/

class CI_Controller {};
class MY_Controller {};
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Config $config
* @property CI_Loader $load
* @property CI_Session $session
*/

class CI_Model {};
于 2013-02-10T20:06:29.250 回答
3

对于 Eclipse PDT:在根 CodeIgniter ciautocomplete.php 中制作上面的粘贴代码(1 个答案)。就是这个。你会很高兴,它是如何工作的:-)

于 2014-08-17T23:07:16.147 回答
0

在控制器中自动完成您自己的模型:

$this->load->model('my_model');

$this->my_model = new My_model();

……

typing: $this->my_model-> 

Eclipse 使用模型的属性和方法自动完成

于 2015-02-20T20:15:50.150 回答