What is the framework for PHP?

A framework gives you standard solutions to typical problems, e.g. for an online shop that can cover the functionality for a customer login (including session handling), a shopping cart, placing orders etc.

There are various framework available for PHP :-
-Laravel
-CodeIgniter
-CakePHP
-Symfony
-Zend Framework 2
-Phalcon
-Yii
-Aura
-Fat-Free
-PHP-MVC
-Kohana
-FuelPHP
- Slim
 
A framework gives you standard solutions to typical problems, e.g. for an online shop that can cover the functionality for a customer login (including session handling), a shopping cart, placing orders...

The big advantage of using a framework is that

You don't need to reinvent the wheel, the code is already there
The code (usually) works, it is already tested
Specifically for user authentication, you will most probably have fewer security leaks as if you invented something from scratch yourself
The big disadvantage is that

If you want to extend the functionality, you have to understand OPC (other peoples code)
If the framework contains a security hole and an exploit is available, your site is immediately vulnerable, but you may not have the knowledge to fix it yourself. So you need to keep a constant lookout on security bulletins, updates, fixes etc.
 
A framework gives you standard solutions to typical problems, e.g. for an online shop that can cover the functionality for a customer login (including session handling), a shopping cart, placing orders...

The big advantage of using a framework is that

You don't need to reinvent the wheel, the code is already there
The code (usually) works, it is already tested
Specifically for user authentication, you will most probably have fewer security leaks as if you invented something from scratch yourself
The big disadvantage is that

If you want to extend the functionality, you have to understand OPC (other peoples code)
If the framework contains a security hole and an exploit is available, your site is immediately vulnerable, but you may not have the knowledge to fix it yourself. So you need to keep a constant lookout on security bulletins, updates, fixes etc.
 
Essentially a framework is the structure that you can choose to build your program on. It can allow you to connect to many different API's as well as determine the structure of your own application. I use the Zend Framework. It's not the easiest to learn, but certainly has everything you need for a great application. I would suggest going through the QuickStart guide on the site to get the ball rolling with this. It uses Model-View-Controller which is essential in my opinion. Once you have it configured, it makes things extremely easier!

Other frameworks include CodeIgniter and Symfony. Some like CodeIgniter for its smaller footprint. It's all a matter of preference. Whichever you pick be sure to use the documentation on the sites as it is essential to understanding how best to use it. Also, don't be scared to peak at the code every once in a while just to get a better understanding of how things work.
 
PHP framework is a library that makes the life of site developer easier by for example hiding some complexities of HTTP protocol or by adding some useful functions. For example the CakePHP implements so called MVC which makes developer to think a level higher than HTTP.
 
Frameworks provide scaffolding that can allow you to develop faster/more cleanly. They often provide toolsets for both the UI components and the underlying database access.

For (very) small projects, a framework can be overkill, but often, it's helpful to provide you with a lot of reusable code.
 
Back
Top