Tag

Frameworks

Browsing

You have done training or internship in PHP and understood the basics, oops concepts, build some projects … Cool.

 Now if you are looking to learn something new on PHP  then this post is going to be useful for you.
Hi there, I am Ankit, will try to make you understand what should you learn after core PHP. Well… There are verify of frameworks on PHP but I will suggest learning the easiest and light-weighted first.

The most popular and trending framework is Laravel. Then you must be thinking “I should learn Laravel ? “.  Of course, you can but if talk about simplicity and easiness then there is no other framework except CodeIgniter. Here we will talk about it.

From my experience, I will suggest CodeIgniter, the first framework to learn.
It is always a good practice to start with small & simple things to learn. If you want to continue you have to learn more than 1 framework.

Once you start with something simple you can get into more complex frameworks like Yii, Symphony, CakePHP, Zend, Laravel, etc.

What is CodeIgniter?

CodeIgniter is a very easy, simple, lightweight, MVC framework of PHP for developing applications rapidly in an easy way. MVC stands for Model View Controller. CodeIgniter’s libraries are out of the box for connecting to the database and performing various operations like sending emails, uploading files, managing sessions, etc. Read more about Library & Frameworks.

Why learn CodeIgniter?

Easy to install

CodeIgniter is also called CI in short. CI has a system folder and index.php.Installation is very easy unlike other PHP frameworks, the Composer is not required for installation.  Just download the stable version from here and extract it to the root directory of your server. Change the base URL in config.php, you are ready to go.

Easy to learn

CI is simply has everything you required to write good code like MCV, Query builders and helper. It takes a couple of weeks to code confidently in CodeIgniter.

CI’s official user guide is excellent with plenty of examples of every topic. It also used in REST API development for mobile applications and making HTTP requests.

After your experience with the easiest and light-weighted CI, Laravel is now easier to pick up. You can do the same thing in different ways. Laravel seems to be a better MCV framework than CodeIgniter but its docs are not good as CI.

Most of the website you visit to get the definition of the framework in software term but unfortunately these definitions are not able to provide you the whole perspective and this question is most of the time is asked in verify of interviews .so trust me this post is gonna for you to completely understand  difference between library and framework. So without wasting any time, let’s get started…


Now let me tell the what the issue is many people say to try to understand what is a library and what is the framework and you get both answers but this is not perfectly a correct thing,  we have to understand both sides by side.


I will explain the framework in a simple way.
Suppose you have to make tea on a daily basis with several ingredients like sugar, tea leaves, other spices, water, etc. In doing this on a regular basis you find it really difficult to put all ingredients in the right ratio all the time. You may miss any item some time and you have to open several boxes one by one.

So one day you got an idea mixing all ingredients in one jar one ratio such that every spoon serves the right ratio mix to tea(excluding milk and water).


Now the jar is your framework. When you have to do a lot of things on a regular basis it requires a lot of time but the framework not only saves time, it also provides a lot of components to your application. Fast and easy.
On the other hand, When you have fewer rules it is a library and when you have more rules and restrictions, of course, it is going to be a framework.
Let’s take an example.


Home and school and you are a student. When you are at home you can place your books, band anywhere you want. But when you are in school you are restricted to come in proper uniform, place your books and bags in the table.


In the same way, you can do anything with the library, modify and use it. In framework you are bounded by rules, you are not allowed to change, yes you can change, but it requires a lot of settings and configuration changes.


In other ways when you have the power to call a  code whenever you like, it is simply a library. In frameworks, It calls the code and your code might call the library. But in framework let it is CodeIgniter, you are restricted like your helper folder should always be a helper, can you change it? Of course, you can, but need to dig up in settings, configurations. API is a bridge that connects the framework and library.


Libraries are a collection of codes, functions that save your time by implementing all the functionality you want. There are different libraries for different tasks. You may not know how the functions inside the library perform their job. You just need to know how to call the library.


While frameworks are just like a library in a way that makes your job easier but you can not call framework as a library you call. If you want to use a framework, you have to learn first.