What is MVC :
The Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller.
Simple MVC Layout
Model does not contain any information about the user interface.It represents the underlying logical structure of data.
which is a collection of classes representing the elements in the user interface .
which represents the classes connecting the model and the view, and is used to communicate between classes in the model and view.
MVC is one of the most frequently used industry-standard web development framework to create scalable and extensible projects.
The MVC pattern helps you create applications that separate the different aspects of the application (input logic, business logic, and UI logic), while providing a loose coupling between these elements. The pattern specifies where each kind of logic should be located in the application. The UI logic belongs in the view. Input logic belongs in the controller. Business logic belongs in the model. This separation helps you manage complexity when you build an application, because it enables you to focus on one aspect of the implementation at a time. For example, you can focus on the view without depending on the business logic.
The loose coupling between the three main components of an MVC application also promotes parallel development. For example, one developer can work on the view, a second developer can work on the controller logic, and a third developer can focus on the business logic in the model.
Why MVC Framewwork:
Multiple view support:
Due to the separation of the model from the view, the user interface can display multiple views of the same data at the same time.
Separation of concerns:
The separation the three components, allows the re-use of the business logic across applications.
Parallel development by separate teams:
It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.
Test-driven development (TDD) :
It provides better support for test-driven development (TDD) . You can use PHPUnit to write tests once you are done programming.
It makes it easier to manage complexity by dividing an application into the model, the view, and the controller , make it speed development possible.
OOPS support :
Promote modern web development practices such as object-oriented programming tools.
Most Popular PHP MVC Framework:
Among several PHP framework ,the choice of framework depends very much on your preferences (and skills) as a developer and on what exactly you are trying to accomplish.
CodeIgniter is a lightweight PHP framework initially released in 2006. CodeIgniter has a very straightforward installation process that requires only a minimal configuration, so it can save you a lot of hassle. It’s also an ideal choice if you want to avoid PHP version conflict, as it works nicely on almost all shared and dedicated hosting platforms.
|website :https://www.codeigniter.com/||Learn With us http://sssoftaid.com|
Yii 2.0 is a modern PHP framework with complete set of features to cater to the needs of modern websites and applications development. Yii also features a very powerful and best in class code generator tool called Gii.
Yii 2 community is very active, helpful and determined to take the Yii 2 framework to the next level. It also hosts one of the best documentation you will see in the world of PHP frameworks.
Symfony ecosystem as a whole consists of large set of reusable components, vibrant and active community, Symfony framework and a philosophy to take PHP to the next level. Symfony framework was first released back in 2005 as open source PHP framework by interactive agency Sensiolabs. It is one of the most actively used framework that ships with a powerful ORM and excellent documentation.
The components of the Symfony 2 framework are used by many impressive projects such as the Drupal, PHPBB, PIWIk etc.
CakePHP is the one of the finest amongst all the open source web application frameworks that follows all the Model-View-Controller (MVC) approach and software design patterns. Good code generation and scaffolding features that rapidly build prototypes to suit all your needs, specially commercial website.
It is an excellent tool for creating web apps that need high-level of security, as it has many built-in security features such as input validation, SQL injection prevention, XSS (cross-site scripting) prevention, CSRF (cross-site request forgery) protection, and many others.
Zend is a robust and stable PHP framework packed with a lot of configuration options therefore it’s usually excellent for more complex project.
Although Laravel is a relatively new PHP framework (it was released in 2011), undisputedly the king of PHP frameworks and spans the widths and depths of large scale web application development. Laravel has a huge ecosystem with an instant hosting and deployment platform, and its official website offers many screencast tutorials called Laracasts.
Laravel team has recently released “Lumen”, a micro PHP framework for the web developers who like to build lightning fast API’s as well as Laravel based services.Laravel comes with its own templating engine named “Blade”.