Let phpstrom support the function of converting the codeigniter framework implementation (GOTO) to definition

Source: Internet
Author: User
Let phpstrom support the codeigniter framework implementation (GOTO) to the defined function 2016-2-9PandaIT PHP

In the previous article, I just mentioned that you can add a ci_phpstrom.php file to support some methods and custom variables in the codeigniter framework. If we use the model layer in the controller, the function of converting CTRL + left to method definition cannot be implemented.

At this time, we need to add the following annotations in the CI_Controller header or The extends class:

/** * @property m_userfound_lockedinfo $m_userfound_lockedinfo * @property m_withdrawal $m_withdrawal * @property m_withdrawal_faildata $m_withdrawal_faildata */class MY_Controller extends CI_Controller{     //...}

In this case, we use

class home extends my_api_controller{    function __construct()    {        parent::__construct();        $this->load->model('m_clientlog');    }        public function index_get()    {        $this->m_clientlog->updateClientLog();    }}

At this time, we can find that the method (function) in m_clientlog will have an automatic prompt function in phpStrom, and the parameter description will be included, this is of great help to improve programming efficiency.

At the same time, I also wrote a code that outputs the annotation Declaration. every time I add or modify the model file, run and copy the file to add the automatic completion prompt.

 ";}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.