PHP Frameworks 
Prateek Bhojak 
VT Netzwelt Pvt. Ltd
What Are They? 
• Add basic functionality 
• Provide an architecture in which to create your 
project 
o Necessarily extensible
Who Cares? (Pros) 
• Promotes code reuse 
• Speed up the coding process by reducing the amount 
of “overhead” code to write, such as: 
o Database access 
o Authentication and session management 
o Data validation and sanitation 
o URL mapping and management 
o Security 
• Code is easier to maintain within an architecture
Cons 
• Fairly steep learning curve 
• Slower than pure PHP 
• Too many to choose from
MVC 
Architectural pattern, separates code by function/purpose. 
- Model - Representation of Information/Data 
- Controller - (Business) Logic 
- View - Output, HTML, javascript..
Top PHP Frameworks 
1. Yii 
2. CodeIgniter 
3. Symfony 
4. Laravel 
5. CakePHP 
6. Zend 
7. Phalcon 
8. Some more like (Slim,ZooP,QPHP)
Use of Frameworks in 2013
In-depth Comparisons
Yii 
• Yii is the most solid PHP framework 
o Fast 
o loads the features that you need 
o Powerful caching support 
o Explicitly designed to work efficiently with AJAX 
o Secure 
o Input validation 
o Output filtering 
o SQL injection and Cross-site scripting prevention 
o Professional 
o Helps you develop clean and reusable code 
o Follows the MVC pattern 
o Ensuring a clear separation of logic and presentation
CodeIgniter 
• Its very powerful framework in PHP simple and elegant 
toolkit to create full-featured web applications. 
• Exceptional performance. 
• Nearly zero configuration. 
• Easy to Understand 
• Simple solutions to complexity. 
• Most Light – weighted.
Symfony 
• Symfony created in 2005 a very powerful MVC 
Framework, Drupal the most popular Open-Source 
CMS uses Symfony components 
• Faster 
• Unlimited flexiblity 
• Stable and sustainable 
• A driver of innovation 
• Interoperable 
• Hard to Learn 
• Highly configurable 
• Ideal for mid- to large-sized teams 
Not for individuals
Laravel 
• Larvael is very fast growing PHP Framework and very 
easy to learn and use. 
– I think this is just about the easiest framework to get into 
– Great routing system that replaces controllers (but controllers can be used too) 
– Easy to use migrations (database creation/updating) 
– Easy to use out-of-the-box authentication and validation 
– It's new, VERY new. 
– If you try to figure out why something's not working, you'll probably land on 
documentation that won't help you. 
– Small community
CakePHP 
CakePHP is a rapid development framework for PHP 
which uses commonly known design patterns like 
Association Data Mapping, Front Controller and MVC. 
• Build Quickly 
• Not much Configuration 
• Clean MVC Conventions 
• Secure
Zend 
• Zend Framework is based on simplicity, object-oriented 
best practices, leading provider of software 
and services for developing, deploying and managing 
business-critical applications in PHP 
• Integrates with other frameworks 
• Great support structure 
• Ideal for mid-sized dev teams 
• Handles complex business logic 
• Easy to port code to
Phalcon 
• Phalcon PHP is “the next big thing” in PHP 
frameworks. 
• It has a really densely-featured framework and written 
the entire source in C and packaged it as a PHP 
extension which makes it incredibly faster
Feature Comparison of some 
frameworks
So why use a framework? 
• Less typing 
• Reusable, helpful methods 
• Most frameworks have (some) built-in security 
• Get a job!
5.3 vs 5.4
How to handle Magic_qoutes 
Data should be escaped where you need it escaped, and for the domain in 
which it will be used. (mysql_real_escape_string -- NOT addslashes! -- 
for MySQL (and that's only unless you have a clue and use prepared 
statements), htmlentities or htmlspecialchars for HTML, etc.), but 
mysql_real_escape_string has been deprecated in 5.5 and will be removed 
in 5.6. Instead, the MySQLi or PDO_MySQL extension should be used, 
but there is plenty of time to get 5.6 in flow, As its stable version is not 
released yet. 
• You need to handle all inputs and escape it. 
Function check_input($value) 
{ 
if (!is_numeric($value)) 
{ 
$value = mysql_real_escape_string($value); 
} 
return $value; 
}
Thank You

My cool new Slideshow!

  • 1.
    PHP Frameworks PrateekBhojak VT Netzwelt Pvt. Ltd
  • 2.
    What Are They? • Add basic functionality • Provide an architecture in which to create your project o Necessarily extensible
  • 3.
    Who Cares? (Pros) • Promotes code reuse • Speed up the coding process by reducing the amount of “overhead” code to write, such as: o Database access o Authentication and session management o Data validation and sanitation o URL mapping and management o Security • Code is easier to maintain within an architecture
  • 4.
    Cons • Fairlysteep learning curve • Slower than pure PHP • Too many to choose from
  • 5.
    MVC Architectural pattern,separates code by function/purpose. - Model - Representation of Information/Data - Controller - (Business) Logic - View - Output, HTML, javascript..
  • 6.
    Top PHP Frameworks 1. Yii 2. CodeIgniter 3. Symfony 4. Laravel 5. CakePHP 6. Zend 7. Phalcon 8. Some more like (Slim,ZooP,QPHP)
  • 7.
  • 8.
  • 9.
    Yii • Yiiis the most solid PHP framework o Fast o loads the features that you need o Powerful caching support o Explicitly designed to work efficiently with AJAX o Secure o Input validation o Output filtering o SQL injection and Cross-site scripting prevention o Professional o Helps you develop clean and reusable code o Follows the MVC pattern o Ensuring a clear separation of logic and presentation
  • 10.
    CodeIgniter • Itsvery powerful framework in PHP simple and elegant toolkit to create full-featured web applications. • Exceptional performance. • Nearly zero configuration. • Easy to Understand • Simple solutions to complexity. • Most Light – weighted.
  • 11.
    Symfony • Symfonycreated in 2005 a very powerful MVC Framework, Drupal the most popular Open-Source CMS uses Symfony components • Faster • Unlimited flexiblity • Stable and sustainable • A driver of innovation • Interoperable • Hard to Learn • Highly configurable • Ideal for mid- to large-sized teams Not for individuals
  • 12.
    Laravel • Larvaelis very fast growing PHP Framework and very easy to learn and use. – I think this is just about the easiest framework to get into – Great routing system that replaces controllers (but controllers can be used too) – Easy to use migrations (database creation/updating) – Easy to use out-of-the-box authentication and validation – It's new, VERY new. – If you try to figure out why something's not working, you'll probably land on documentation that won't help you. – Small community
  • 13.
    CakePHP CakePHP isa rapid development framework for PHP which uses commonly known design patterns like Association Data Mapping, Front Controller and MVC. • Build Quickly • Not much Configuration • Clean MVC Conventions • Secure
  • 14.
    Zend • ZendFramework is based on simplicity, object-oriented best practices, leading provider of software and services for developing, deploying and managing business-critical applications in PHP • Integrates with other frameworks • Great support structure • Ideal for mid-sized dev teams • Handles complex business logic • Easy to port code to
  • 15.
    Phalcon • PhalconPHP is “the next big thing” in PHP frameworks. • It has a really densely-featured framework and written the entire source in C and packaged it as a PHP extension which makes it incredibly faster
  • 16.
    Feature Comparison ofsome frameworks
  • 17.
    So why usea framework? • Less typing • Reusable, helpful methods • Most frameworks have (some) built-in security • Get a job!
  • 18.
  • 30.
    How to handleMagic_qoutes Data should be escaped where you need it escaped, and for the domain in which it will be used. (mysql_real_escape_string -- NOT addslashes! -- for MySQL (and that's only unless you have a clue and use prepared statements), htmlentities or htmlspecialchars for HTML, etc.), but mysql_real_escape_string has been deprecated in 5.5 and will be removed in 5.6. Instead, the MySQLi or PDO_MySQL extension should be used, but there is plenty of time to get 5.6 in flow, As its stable version is not released yet. • You need to handle all inputs and escape it. Function check_input($value) { if (!is_numeric($value)) { $value = mysql_real_escape_string($value); } return $value; }
  • 31.