0% found this document useful (0 votes)
25 views

Phpframework 171218094819

The document discusses various PHP frameworks and the MVC design pattern. It explains what frameworks are, some popular PHP frameworks like CodeIgniter, Yii, CakePHP and Zend, and the basics of the MVC pattern including models, views and controllers. The benefits of using frameworks and MVC are also covered.

Uploaded by

Ahmad Ali Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Phpframework 171218094819

The document discusses various PHP frameworks and the MVC design pattern. It explains what frameworks are, some popular PHP frameworks like CodeIgniter, Yii, CakePHP and Zend, and the basics of the MVC pattern including models, views and controllers. The benefits of using frameworks and MVC are also covered.

Uploaded by

Ahmad Ali Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

What is Framework?

Framework provide scaffolding that can allow you to


develop faster/more cleanly structure. This Framework
helpful to provide you with a lot of reusable codes.
Some notable frameworks for PHP.
What is a PHP Framework?

• PHP Framework is the most popular scripting


language for many different reasons. Flexibility ,ease of
use. Its basic platform that allows us to develop
web application.
• It is provide the structure.
• You will end up saving loads of time, stopping the need to
produce repetitive code.
Principles Of MVC for PHP Developers

MVC stands for model view controller. It is good way to


clean, scalable, powerful and fast application.

Model
Model is the name given to the component that will
communicate with the database to manipulate the data. It
acts as a bridge between the View component and the
Controller component in the overall architecture
The code snippet for
running first_model.php is:

<?php
class Model
{
public $string;
public function __construct()
{
$this->string = “Let’s start php with MVC”;
}
}
?>
View :

The View requests for data from the Model component


and then its final output is determined. View interacts
with the user, and then transfers the user’s reaction to
the Controller component to respond accordingly.
To run first_view.php, type:

<?php
class View
{
private $model;
private $controller;
public function __construct($controller,$model)
{
$this->controller = $controller;
$this->model = $model;
}
public function output()
{
return “<p>”. $this->model->string . “</p>”;
}
}
?>
Controller
The Controller’s job is to handle data that the user inputs or
submits through the forms, and then Model updates this
accordingly in the database.
The code snippet for running first_controller.php is:

<?php
class Controller
{
private $model;
public function __construct($model)
{
$this->model = $model;
}
}
?>
Model of MVC:
Working:

The workings of a PHP framework is referred as Model View


Controller(MVC). MVC is an architectural pattern in
programming that isolates business logic from the UI,
allowing one to be modified separately from the other (also
known as separation of concerns). With MVC, Model refers to
data, View refers to the presentation layer, and Controller to
the application or business logic. MVC break up the process
of development of an application, so you can work on
individual elements while others are unaffected. Essentially,
this makes coding in PHP faster and less complicated.
Why framework?

Some features are given below,

1. Clean Urls ( SEO friendly Urls )

2. We can standardization!

3 .Security

4. Extensibility

5. Fast Loading

6. Reusable of code

7. increase flexibility
When to use a PHP Framework?

A framework will provide more simplicity module as well


stability in coding so it may be a good idea to use PHP
frameworks whenever possible. It will reduce time or
eliminate bad coding and speed up the build process. PHP
programmers see frameworks as tools for “weak”
programmers that don’t understand how to write good,
clean code. Whether this is true or not is up for debate, but
the fact of the matter is that PHP frameworks are a tool
that can be used to save time and tighten up one’s coding.
Benefits of using MVC

 User interface components:


 Multiple simultaneous views of the same model
 Synchronized views
 Easier user interface changes
 Easier testing
 Substitutable user interface
 Reduces the amount of repetitive coding
Disadvantages of using MVC

 More complexity
 Potensial for excessive updates
 Close coupling between view and controllers
Top 10 frameworks are available:

 Code Igniter

 Yii

 Cake PHP

 Zend

 Symfony

 PHP DevShell
 Prado

 Akelos

 Zoop

 QPHP
1. Codelgniter:
It is well-known for its ease-of-use, performance and
speed.
It offers simple solutions, and has an extensive library of
video tutorials, forums, a user guide and wiki available for
support. Beginners should consider using Codelgniter.

2. Yii:
Yii is an open source, object-oriented, component-based
MVC PHP web application framework.
3. CakePHP:
CakePHP is open source web framework. To make
developing, deploying and maintaining application. It is
base on MVC model.

4. Zend :
Zend Framework is the open source, object oriented web
application framework for PHP 5. Zend Framework is
often called a 'component library', because it has many
loosely coupled components that you can use more or less
independently.
5. Symfony :
Symfony is a PHP web application framework and a set
of reusable PHP components/libraries. The leading PHP
framework to create websites and web applications.
Built on top of the Symfony Components.

6.PhpDevShel:
PHPDevShell is an Open Source PHP framework for the
development of admin-based applications. It is fast,
stable and secure, could be also described as a Rapid
Application Development freamework use in php.
7. Prado:
The Prado framework is an open source programming
framework for creating professional web applications.
PRADO means PHP Rapid Application Development
Object-oriented. It is component-based and allows event-
driven programming

8. Akelos :
Akelos PHP Framework is a web application development
platform that is entirely based on the MVC (Model View
Controller) design pattern. It speeds up the creation of
complex web applications writing less code. Most of all it is
very prominent for creating and maintaining applications with
data and views in different and multiple languages at the same
time.
9. Zoop :
Zoop is an object oriented framework. Zoop framework
development is scalable, fast, efficient, clean, stable and
portable of course. This framework can be selected to
include only the required functionality and this is even
extendable.

10. QPHP:
It is event driven( EDP),component based web Fremework
similar as architecture to ASP.NET.This is a tool which
will help you to build any Php based website in very
easy, fast, reliable,safe way.
Comparison of framework:
• Resourses:

• CakePHP official site


• CodeIgniter Site
• http://codeigniter.com
• PHP frameworks lists
• https://phpframework.com/

You might also like