让PHPStorm支持CodeIgniter 2让PHPStorm支持CodeIgniter 2.docVIP

  • 9
  • 0
  • 约5.92千字
  • 约 5页
  • 2017-04-19 发布于贵州
  • 举报

让PHPStorm支持CodeIgniter 2让PHPStorm支持CodeIgniter 2.doc

让PHPStorm支持CodeIgniter 2.x.x Step1:下载含有doc注释的文件 访问/1697338 (也可以使用和此文档在一起的CI_phpStorm.php文件) 下载后解压压缩包,并复制CI_phpStorm.php文件到项目根路径(和index.php,system文件夹,application文件夹在同一个目录)。如图1 图1 Step2:使变更生效 关闭项目,并重新打开项目,以便PHPStorm扫描此文件。(一般无需进行此步骤) Step3:完成,测试下 写个控制器/application/controllers/home.php ?php if ( ! defined(BASEPATH)) exit(No direct script access allowed); class Home extends CI_Controller { public function index() { $this-load-view(home); } } /* End of file home.php */ /* Location: ./application/controllers/home.php */ 图2 如图2 , Ctrl+Q就可以看到Doc文档了 图3 如图3,代码自动提示。 附注: 还有一种方式就是将CI_phpStorm.php文件中的phpdoc复制到对应的类的上面。如system/core/Controller.php的内容可以修改成如下(红色斜体为添加的内容,system/core/Model.php同理): ?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 /user_guide/license.html * @link * @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. * * @package CodeIgniter * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team * @link /user_guide/general/controllers.html * @property CI_DB_active_record $db This is the platform-independent base Active Record implementation class. * @property CI_DB_forge $dbforge Database Utility Class * @property CI_Benchmark $benchmark This class enables you to mark points and calculate the time difference between them.br / Memory consumption can also be displayed. * @property CI_Calendar $calendar This class enables the creation of calendars * @property CI_Cart $cart Shopping Cart

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档