Top 10 PHP frameworks for 2014

Thursday, 3 April 2014

PHP frameworks are super useful tools when it comes to clean and structured web development, as they speed up the creation and maintenance of your PHP web applications. In this article, I have compiled (in no particular order) my 10 favorite PHP frameworks.

Laravel


Probably the most popular PHP framework right now. Laravel is powerful and elegant while still being easy to learn and use. Definitely worth giving a try!
→ More info/download

Flight


Flight is a fast, simple, extensible micro framework for PHP which enables you to quickly and easily build RESTful web applications. Easy to use and to learn, simple yet powerful.
→ More info/download

Yii


Yii is a high-performance PHP framework for developing Web 2.0 applications. Yii comes with rich features: MVC, DAO/ActiveRecord, I18N/L10N, caching, authentication and role-based access control, scaffolding, testing, etc.
→ More info/download

Medoo


Medoo is the lightest PHP database as it consists of only one file of 10,9kb. A great micro framework for small and simple applications.
→ More info/download

PHPixie


Originally a fork of the Kohana framework, PHPixie is among my favorite new frameworks: MVC compliant, fast to learn, powerful. You should try it sometime soon!
→ More info/download

CodeIgniter


Although being a bit old and reaching the end of its life, I definitely love CI which is a great MVC framework. I’ve used it countless times on many project and I never was disappointed.
→ More info/download

Kohana


Kohana is an open source, object oriented MVC web framework built using PHP5 by a team of volunteers that aims to be swift, secure, and small.
→ More info/download

Symfony


Created in 2005, Symfony is a very powerful MVC framework and is quite popular in the enterprise world. It was heavily inspired by other Web Application Frameworks such as Ruby On Rails, Django, and Spring. Symfony is probably one of the most complete PHP frameworks.
→ More info/download

Pop PHP


While some PHP frameworks are pretty complex and intense, Pop has been built with all experience levels in mind. Pop has a manageable learning curve to help beginners get their feet wet with a PHP framework, but also offers robust and powerful features for the more advanced PHP developer.
→ More info/download

Phalcon


Phalcon is an open source, full stack framework for PHP 5 written as a C-extension, optimized for high performance. You don’t need to learn or use the C language, since the functionality is exposed as PHP classes ready for you to use. Phalcon also is loosely coupled, allowing you to use its objects as glue components based on the needs of your application.
→ More info/download

Destructor:

Monday, 13 January 2014

Like a constructor function you can define a destructor function using function __destruct(). You can release all the resourceses with-in a destructor.

Inheritance:

PHP class definitions can optionally inherit from a parent class definition by using the extends clause. The syntax is as follows:
  class Child extends Parent {
     <definition body>
  }
The effect of inheritance is that the child class (or subclass or derived class) has the following characteristics:
  • Automatically has all the member variable declarations of the parent class.
  • Automatically has all the same member functions as the parent, which (by default) will work the same way as those functions do in the parent.
Following example inherit Books class and adds more functionality based on the requirement.
class Novel extends Books{
   var publisher;
   function setPublisher($par){
     $this->publisher = $par;
   }
   function getPublisher(){
     echo $this->publisher. "<br />";
   }
}
Now apart from inherited functions, class Novel keeps two additional member functions.

Constructor Functions:

Constructor Functions are special type of functions which are called automatically whenever an object is created. So we take full advantage of this behaviour, by initializing many things through constructor functions.
PHP provides a special function called __construct() to define a constructor. You can pass as many as arguments you like into the constructor function.
Following example will create one constructor for Books class and it will initialize price and title for the book at the time of object creation.
function __construct( $par1, $par2 ){
   $this->price = $par1;
   $this->title = $par2;
}
Now we don't need to call set function separately to set price and title. We can initialize these two member variables at the time of object creation only. Check following example below:
   $physics = new Books( "Physics for High School", 10 );
   $maths = new Books ( "Advanced Chemistry", 15 );
   $chemistry = new Books ("Algebra", 7 );

   /* Get those set values */
   $physics->getTitle();
   $chemistry->getTitle();
   $maths->getTitle();

   $physics->getPrice();
   $chemistry->getPrice();
   $maths->getPrice();
This will produce following result:
  Physics for High School
  Advanced Chemistry
  Algebra
  10
  15
  7
 

Total Pageviews

Blogroll

Most Reading