Article Content:5 tips to increase your productivity with codeigniter

5 tips to increase your productivity with codeigniter

5 tips to increase your productivity with codeigniter.

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.


Remember: that HMVC Warez used only with Codeigniter 2 and Codeigniter 3 version, Codeigniter 4 use namespaces to handle modular approach


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


Note: Codeigniter 4 will come with its own base model and it is syntax much like this class.


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.

Notify me of followup comments via e-mail.
You can also Subscribe without commenting.