📜 ⬆️ ⬇️

NetBeans CodeIgniter auto-complete

In the wake of NetBeans interest, I’ll tell you a little hint. I work mostly with CodeIgniter, and this is what I’m badly lacking in the IDE. This is a quick autocompletion for the built-in functions (libraries, helpers) - like $ this → form_validation → ...

Now I will tell you how to implement it:


In fact, everything is extremely simple, you need to put a file in the project with something like this:
')
  1. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  2. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  3. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  4. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  5. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  6. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  7. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  8. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  9. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  10. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  11. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  12. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  13. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  14. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  15. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }
  16. <?php
    /**
    * @property CI_Loader $load
    * @property CI_Form_validation $form_validation
    * @property CI_Input $input
    * @property CI_Email $email
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Table $table
    * @property CI_Session $session
    * @property CI_FTP $ftp
    * ...
    */
    Class Controller {

    }


I put it in a folder with pictures, calling something like temp.php. After that, updating the project, already worked normally and comfortably:
netbeans codeigniter
In 6.5, auto-completion was picked up right away, in 6.7M2 there isn’t, after adding to the PHP project the Include Path folder with the project also worked as it should.
As far as I know, similarly, you can screw up auto-completion for symfony.

UPD: Gentlemen, I forgot to say the most important thing! Similarly, you can prokidyvat your model in autocomplete:
...
* @property Sitemenu $sitemenu
...



______________________
The text was prepared in the Habr Editor from © SoftCoder.ru

Source: https://habr.com/ru/post/55333/


All Articles