CI框架调用系统类库链接提示方法快捷选择
来源:互联网 发布:买域名送空间 编辑:程序博客网 时间:2024/06/02 17:47
我们的控制器类主要是继承CI_Controller,因此只要在CI_Controller类的头部添加属性对应相关类即可。或许说的不明,请直接看代码。文件:system/core/Controller.php
@property为添加的属性说明代码。
调用实例如:$this->input->get();在IDE中当输入到input->时就会提示get等相关方法。
我们在调用自己model类方法也是一样的道理,如
1、我们写了一个test_model.php类(Test_model extends CI_Model)。
2、再写一个控制器test.php(Test extends CI_Controller)。
test.php代码:
@property为添加的属性说明代码。
调用实例如:$this->input->get();在IDE中当输入到input->时就会提示get等相关方法。
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* CodeIgniter Application Controller Class
*
* This class object is the super class that every library in
* CodeIgniter will be assigned to.
*
* @property CI_Loader $load
* @property CI_DB_active_record $db
* @property CI_Calendar $calendar
* @property CI_Email $email
* @property CI_Encrypt $encrypt
* @property CI_Ftp $ftp
* @property CI_Hooks $hooks
* @property CI_Image_lib $image_lib
* @property CI_Language $language
* @property CI_Log $log
* @property CI_Output $output
* @property CI_Pagination $pagination
* @property CI_Parser $parser
* @property CI_Session $session
* @property CI_Sha1 $sha1
* @property CI_Table $table
* @property CI_Trackback $trackback
* @property CI_Unit_test $unit
* @property CI_Upload $upload
* @property CI_URI $uri
* @property CI_User_agent $agent
* @property CI_Validation $validation
* @property CI_Form_validation $form_validation
* @property CI_Xmlrpc $xmlrpc
* @property CI_Zip $zip
* @property CI_Config $config
* @property CI_Input $input
* @property CI_Cache $cache
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/general/controllers.html
*/
class CI_Controller {
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* CodeIgniter Application Controller Class
*
* This class object is the super class that every library in
* CodeIgniter will be assigned to.
*
* @property CI_Loader $load
* @property CI_DB_active_record $db
* @property CI_Calendar $calendar
* @property CI_Email $email
* @property CI_Encrypt $encrypt
* @property CI_Ftp $ftp
* @property CI_Hooks $hooks
* @property CI_Image_lib $image_lib
* @property CI_Language $language
* @property CI_Log $log
* @property CI_Output $output
* @property CI_Pagination $pagination
* @property CI_Parser $parser
* @property CI_Session $session
* @property CI_Sha1 $sha1
* @property CI_Table $table
* @property CI_Trackback $trackback
* @property CI_Unit_test $unit
* @property CI_Upload $upload
* @property CI_URI $uri
* @property CI_User_agent $agent
* @property CI_Validation $validation
* @property CI_Form_validation $form_validation
* @property CI_Xmlrpc $xmlrpc
* @property CI_Zip $zip
* @property CI_Config $config
* @property CI_Input $input
* @property CI_Cache $cache
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/general/controllers.html
*/
class CI_Controller {
..........省略...........
我们在调用自己model类方法也是一样的道理,如
1、我们写了一个test_model.php类(Test_model extends CI_Model)。
2、再写一个控制器test.php(Test extends CI_Controller)。
test.php代码:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
* @property Test_model $test_model
* @author LINK TEAM
*
*/
class Test extends CI_Controller {
/**
*
* @property Test_model $test_model
* @author LINK TEAM
*
*/
class Test extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("test_model");
}
{
parent::__construct();
$this->load->model("test_model");
}
public function test()
{
$query = $this->test_model->getdata();//这里的方法在IDE中就会自动提示选择
}
{
$query = $this->test_model->getdata();//这里的方法在IDE中就会自动提示选择
}
}
0 0
- CI框架调用系统类库链接提示方法快捷选择
- ci框架关闭notice消息提示方法
- PHP CI 框架多数据库链接
- 使PhpStorm支持CI框架语法提示的方法
- CI里 自定义类 调用系统类
- 【ci框架】扩展系统的核心类
- 【ci框架】ci框架邮件发送类库
- ci框架 动态选择数据库
- CI 框架各类库的加载方法
- CI框架调用第三方类库
- [ssh] 创建快捷链接方法
- Java框架JNA调用C方法(windows链接库dll文件、linux链接库so文件)
- Android调用支付宝快捷支付时提示"系统繁忙,请稍后再试(ALI64)"错误
- Android调用支付宝快捷支付时提示"系统繁忙,请稍后再试(ALI64)"错误
- Android调用支付宝快捷支付时提示"系统繁忙,请稍后再试(ALI64)"错误
- 【ci框架】CI框架支持$_GET两种方法
- CI框架的全局函数、类库中调用model层的方法
- CI 框架 调用PHPExcel linux 无效问题
- SVN版本冲突解决详解
- IOS之UILabel自适应高度
- Redis配置文件参数说明
- JNI jbytearray资料
- Effective c++(笔记)----类与函数之实现
- CI框架调用系统类库链接提示方法快捷选择
- “治理”微信们:国家“专项行动”的商业反响
- json 入门指南
- 拦截导弹
- 测试一下足迹
- 一族巧用网络来脱光浏览
- Android ListView图片异步加载时,图片错位的问题
- Java中String和Date、Timestamp之间的相互转换
- Linux-DNS配置 安装oracle11g rac