CodeIgniter 3.1.11 is the current version of the framework, intended for use with PHP 5.6+. There have been a number of refinements since version 2, notably with the database, session handling and encryption. Development of this version is ongoing. CodeIgniter Rocks. CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. A PhpStorm plugin for CodeIgniter development.
As a developer, you may familiar with this concept .DRY. Which means don't reinvent the wheel?
All we do to make our life much easier because this will increase productivity which converts at the end to money
So I thought to share simple tips from my experience that will help you in Codeigniter projects and makes your life easier
1- Use HMVC approach
If you don’t know what is HMVC
A. Modular HMVC is: Hierarchy of multiple MVC triads
Separate your code as modules makes your code clean, easy to maintain and gives you the chance to reusing code many times without effort to mention
The most popular HMVC wiredesignz is my favorite tool.
Codeigniter modular application is the way to go because every module handles a specific logic, so collect similar controllers and models ,libraries in one module let you less confusing and after a while, you could remember what you did in this module, then it will be easy to copy module with all its own code.
2- Use Base model
If you don't know what base model you should know about it is, basically it is a parent model class which provides the most popular functions that every developer needs for every project
As an example, every project needs CRUD functionality (create-read-update-delete).
So rather than write those functions more and more, you just call one inherited function with Short syntax and it will do the magic.
So if you have a ton of models this will increase your productivity and you would notice that .
also, it will make your model thin because you will focus on the project specific logic.
I suggest to use this Codeigniter base model, it is simple, light and you can customize for your tasks
3- Build your own helper
Usually, In many projects, there were something repeated and you were forgetting to change or may by lazy like me to change.
Something like truncate functions which count and cut number of words
Or a function to create thumbnails for images to fit website design or date converter function.
You should collect those functions and build your own helper to use in all projects. This habit will make you code cleaning and fewer efforts.
4- Use a better editor
My best choice is Phpstorm ,I love this editor, it has all tool you need as a PHP developer, you can manage FTP very well ,you can manage VCS with GIT repository without worried about commands ,I have already make a git course to this subject and it will complete as soon as possible
Also, you can make your shortcuts for repetitive codes to reduce coding time and save these settings anywhere to share between many computers.
As example many time I use
to show what query run behind the scene this helps me a lot to fix database query errors so I thought to make a shortcut for this like this (lst) ,So whenever I write these three characters the Phpstorm complete the remains.
Another thing you may notice, that Phpstorm has many plugins to support many things like composer and also PHP frameworks, content management systems, but
Unfortunately, Codeigniter not being one of them which means you cannot take advantage of auto-completion.
Although supporting Codeigniter in Phpstorm not found yet, but you will find PHP storm Codeigniter helper which will help you a lot with auto complete in Codeigniter.
After downloading this helper you can copy the code and put in parent class which you inherited from in all your project classes and it will give you decent autocompletion support.
5- Google it, be smarter.
In PHP world you are not alone, in Codeigniter world the same, always there was the same problem that someone ran into beforehand.
So don't reinvent the wheel, just take your time to search, look at other’s code this will help you twice, to improve your coding skills and to increase your productivity.
Sometimes you will find the solution in Codeigniter forum, sometimes in Codeigniter blogs like Webeasystep :) or maybe in PHP community, then your role to convert it to a code igniter library or helper to make our community rich.
These my quick tips to share and I hope to help you and will be very happy with your shares
Leave a Reply
Your email address will not be published.Use this dialog to configure running and debugging of PHP applications on a remote server. According to the settings of this configuration, PhpStorm fully controls the debugging process: it launches the application, opens the browser, and activates the debugging engine. A PHP Web Page debug configuration tells PhpStorm the URL address to access the starting page of the application, the browser to open the starting page in, and the debug server configuration to use. For details, see Debug with a PHP web page debug configuration.
Config Codeigniter Phpstorm
Configuration area
Item | Description |
---|---|
Server | Use this list to specify the Web server configuration to use. The list shows all the configurations that are currently available in PhpStorm. |
Click this button to open the Servers page and view the details of the selected configuration there. | |
Start URL | In this area, compose the URL address to access the application through. In the Start URL field, specify the local file that implements the starting page of the application. Type the path to the desired file relative to the folder that is mapped to the root folder of the target host. PhpStorm concatenates the host root URL with the specified relative path and shows the URL address of the application starting page in the read-only field below. |
Browser | From this list, select the Web browser to open the application in. |
Common
When you edit a run configuration (but not a run configuration template), you can specify the following options:
Item | Description |
---|---|
Name | Specify a name for the run/debug configuration to quickly identify it when editing or running the configuration, for example, from the Run popup Alt+Shift+F10. |
Allow parallel run | Select to allow running multiple instances of this run configuration in parallel. By default, it is disabled, and when you start this configuration while another instance is still running, PhpStorm suggests to stop the running instance and start another one. This is helpful when a run/debug configuration consumes a lot of resources and there is no good reason to run multiple instances. |
Gbf upgrade siero shop. Store as project file | Save the file with the run configuration settings to share it with other team members. The default location is .idea/runConfigurations. However, if you do not want to share the .idea directory, you can save the configuration to any other directory within the project. By default, it is disabled, and PhpStorm stores run configuration settings in .idea/workspace.xml. |
Toolbar
The tree view of run/debug configurations has a toolbar that helps you manage configurations available in your project as well as adjust default configurations templates. Mazhathullikilukkam mp3 songs.
Item | Shortcut | Description |
---|---|---|
Alt+Insert | Create a run/debug configuration. | |
Alt+Delete | Delete the selected run/debug configuration. Note that you cannot delete default configurations. | |
Ctrl+D | Create a copy of the selected run/debug configuration. Note that you create copies of default configurations. | |
The button is displayed only when you select a temporary configuration. Click this button to save a temporary configuration as permanent. | ||
View and edit the template (that is, the default run/debug configuration settings). The templates are displayed under the Templates node and used for newly created configurations. | ||
/ | Alt+Up/ Alt+Down | Move the selected run/debug configuration up and down in the list. The order of configurations in the list defines the order, in which the configurations appear when you choose a run/debug configuration. Default templates of run/debug configurations are always sorted alphabetically. |
Move into new folder / Create new folder. You can group run/debug configurations by placing them into folders. To create a folder, select the configurations within a category, click , and specify the folder name. If only a category is in focus, an empty folder is created. Then, to move a configuration into a folder, between the folders or out of a folder, use drag or and buttons. To remove grouping, select a folder and click . | ||
Click this button to sort configurations in the alphabetical order. |
Before Launch
Phpstorm Codeigniter 설정
In this area, you can specify tasks to be performed before starting the selected run/debug configuration. The tasks are performed in the order they appear in the list.
Codeigniter Phpstorm Code Completion
Item | Shortcut | Description |
---|---|---|
Alt+Insert | Click this icon to add one of the following available tasks:
| |
Alt+Delete | Click this icon to remove the selected task from the list. | |
Enter | Click this icon to edit the selected task. Make the necessary changes in the dialog that opens. | |
/ | Alt+Up/ Alt+Down | Click these icons to move the selected task one line up or down in the list. The tasks are performed in the order that they appear in the list. |
Show this page | Select this checkbox to show the run/debug configuration settings prior to actually starting the run/debug configuration. | |
Activate tool window | By default this checkbox is selected and the Run or the Debug tool window opens when you start the run/debug configuration. Otherwise, if the checkbox is cleared, the tool window is hidden. However, when the configuration is running, you can open the corresponding tool window for it yourself by pressing Alt+4 or Alt+5. |