ReePrime
Lynda. Up and Running with PHP CodeIgniter / Section 2 - 2. Introducing the MVC development pattern

Hosted by Dailymotion. For legal issues report at the Copyright Center, report us on DMC, or use the Instant Removal tool.

Lynda. Up and Running with PHP CodeIgniter / Section 2 - 2. Introducing the MVC development pattern

M
Mubasharamin52

3 Views • Aug 22, 2014

Description

Introducing the MVC development pattern

I'm going to explain MVC at only a very high level as this courses focus is on CodeIgniter . For a more comprehensive description I recommend MVC Frameworks for Building PHP Web Applications with Drew Falkman here in the lynda.com online training library. MVC stands for Model-View-Controller. It's a software design pattern that separates the representation of information from user interaction. This explicit separation of components allows for greater code reusability and logical separation of program responsibilities.

In short MVC keeps code organized, which in turn helps projects and teams. CodeIgniter uses a loose approach to MVC which I'll get into more detail in a bit. There are three components to MVC. The first, model is the representation of data structures, business rules, and functions. This is where really basic, create, read, update, and destroy or CRUD functionality is defined. Next is a View, which is a representation of the information that's presented to the user. The View is where all HTML rendering takes place.

The most program logic that's in a View is a really simple if, then, like if something exists then display it. Anything that takes more logic than that, like deciding what to do based on user input, is delegated to the controller, which serves as kind of an intermediary between the model and the view. The controller sends commands to the other components like model, save yourself, then view, show a message saying that the model was saved. As a visual explanation of a regular interaction, a site user will send a command to the controller which will in turn manipulate the model, like create this record, for example. Through which the control updates the View with a confirmation that the record has been updated.

The User sees the final HTML representation in the View. Earlier, I mentioned that CodeIgniter uses a loose approach to MVC. To be clear, CodeIgniter's use of models is unique and does not precisely fit in traditional definition within a model MVC design patterns. They're more like a domain object, which is a collection of properties. Models in Codelgniter are optional. Depending on your project needs, you can completely leave it out, leaving only a minimal application with just controllers and views. I'm going to demonstrate Codelgniter's implementation of models. Now that we've got this theory out of the way, let's start building an application by installing the Codelgniter framework.

More from User

06:05

Lynda. Up and Running with PHP CodeIgniter / Section 4 -2. Creating a form to add magazines

Mubasharamin52

05:09

Lynda. Up and Running with PHP CodeIgniter / Section 3 -4. Displaying a magazine

Mubasharamin52

01:07

Lynda. Up and Running with PHP CodeIgniter /4. Adding Functionality with Libraries Section 4 -1. What are CodeIgniter libraries

Mubasharamin52

13:14

Lynda. Up and Running with PHP CodeIgniter / Section 3 - 3. Saving magazines using active records

Mubasharamin52

04:12

Lynda. Up and Running with PHP CodeIgniter / Section 3 - 2. Modeling a magazine

Mubasharamin52

01:30

Lynda. Up and Running with PHP CodeIgniter / Section 3 - 1. What is a model and how is it used

Mubasharamin52

Related Videos

01:46

Hire PHP Developer, PHP Developer, PHP Development Company, PHP Application Development, Hire PHP Programmer, PHP Developer, PHP Web Development, PHP Web Development Company, PHP Development Company, PHP Web Developer, PHP Developers, Hire Dedicated PHP

David Mathew

03:14

Lynda. Up and Running with PHP CodeIgniter / Section 2 - 3. Installing CodeIgniter

Mubasharamin52

01:07

Lynda. Up and Running with PHP CodeIgniter /4. Adding Functionality with Libraries Section 4 -1. What are CodeIgniter libraries

Mubasharamin52

03:11

Lynda. Up and Running with PHP CodeIgniter / Section 2 - 1. What is CodeIgniter and why should I use it by Mr. Mubashar

Mubasharamin52

00:35

Offshore-Laravel-PHP-Development- Hire- Laravel-PHP-Developers-Outsource Laravel PHP Development

summationithyd

13:14

Lynda. Up and Running with PHP CodeIgniter / Section 3 - 3. Saving magazines using active records

Mubasharamin52