CodeIgniter的Netbeans代码完成 [英] Netbeans code completion for CodeIgniter
问题描述
我使用Netbeans IDE进行Php开发。它给我Kohana框架的代码完成。有没有办法在Netbeans中为CodeIgniter完成代码?
I am using Netbeans IDE for Php development. It gives me code completion for Kohana framework. Is there any way to have code completion for CodeIgniter in Netbeans?
推荐答案
在nbproject中创建一个新目录(我使用此目录,选择的名称,我使用 CI_Autocomplete
。
Create a new directory inside nbproject (I used this since it’s omitted when pushing to prod) with your name of choice, I used CI_Autocomplete
.
使用您的名字创建一个新文件, c $ c> CI_Autocomplete_2.0.php ,并将其放在新创建的文件夹 nbproject\CI_Autocomplete
内。
Create a new file with your name of choice, I used CI_Autocomplete_2.0.php
, and place it inside the newly created folder, nbproject\CI_Autocomplete
.
将以下代码粘贴到新文件 CI_Autocomplete_2.0.php
内。
Paste the below code inside the new file, CI_Autocomplete_2.0.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 {};
/**
* @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 {};
?>
现在转到(这是为OSX,所以不知道它是否与Windows相同)文件>项目属性(projectname)> PHP包含路径
,并包括您在上面创建的新文件夹 nbproject\CI_Autocomplete
。
Now go to (this is for OSX so not sure if it’s the same for Windows) File > Project Properties (projectname) > PHP Include Path
and include the new folder you created above, nbproject\CI_Autocomplete
.
重新启动您的专案,自动完成功能即可正常运作。
Restart your project and autocomplete will work.
这篇关于CodeIgniter的Netbeans代码完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!