donglin5770 2011-09-04 13:54
浏览 40
已采纳

CI_DB_mysql_driver NetBeans中的CodeIgniter类自动完成

I'm developing project by CodeIgniter in NetBeans IDE.

first of each of my file (Model and Controller) I add

/**
* @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_Security $security
* @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 $agent
* @property CI_Validation $validation
* @property CI_Xmlrpc $xmlrpc
* @property CI_Xmlrpcs $xmlrpcs
* @property CI_Zip $zip
* @property Image_Upload $image_upload
* @property Lang_Detect $lang_detect

 * * * * * * * * Model * * * * * *

* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Config $config
* @property CI_Loader $load
* @property CI_Session $session
* @property Address_Model $address_model
* @property Admin_Model $admin_model
* @property Buyer_Model $buyer_model
* @property Email_Model $email_model
* @property Product_Model $product_model
* @property Store_Model $store_model
* @property Tailor_Model $tailor_model
 */

to add auto complete to it.

but when I wanna to use query like $query = $this->db->query("YOUR QUERY");

$query don't support auto complete,when I used var_dump($query) I found this is CI_DB_mysql_driver object.

now how can I add CI_DB_mysql_driver to auto complete list by $query name?

  • 写回答

3条回答 默认 最新

  • duanhongxian6982 2011-11-18 21:12
    关注

    I found a bit of a hack.

    1) add:

    @property CI_DB_result $query
    

    To your model.

    Then rather than $query = $this->db->query(), Use $this->query = $this->db->query().

    Then, as you type $this->query, the autocompleter will come up as expected.

    This will be troublesome though if you need to have 2 queries active, or a query within a loop from another query. In such cases, you would have to have 2 variables for each query.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘