MVC – Model View Controller

Slides:



Advertisements
Similar presentations
Class03 Introduction to Web Development (Hierarchy and the IDE) MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University.
Advertisements

Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Class02 More Arrays MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 1/14/2016.
Responsive Web Design (RWD) MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/11/2016.
Form Data (part 2) MIS 3502, Fall 2015 Brad N Greenwood, PhD Department of MIS Fox School of Business Temple University 11/10/2015 Slide 1.
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
Sessions and cookies MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 4/12/2016.
PDO Database Connections MIS 3501, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 3/8/2016.
JavaScript, AJAX and JSON MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/9/2016.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
PDO Database Connections
Class03 Introduction to Web Development (Hierarchy and the IDE)
Brad N Greenwood, PhD MBA
Sessions and cookies MIS 3501 Jeremy Shafer Department of MIS
Form Data (part 2) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
Organize your code with MVC
Jim Fawcett CSE686 – Internet Programming Spring 2012
Introduction to Web Development (Part 2)
PHP: includes MIS 3501 Jeremy Shafer Department of MIS
Sessions and cookies (part 2)
jQuery – Form Validation
Form Data (part 1) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
Class07 PHP: loops and includes
PDO Database Connections
How to get data from a form
PHP Functions, Scope MIS 3501, Fall 2015 Jeremy Shafer
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
Introduction to JavaScript
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
A second look at JavaScript
Getting started with jQuery
Ajax and JSON (jQuery part 2)
PDO Database Connections
Organize your code with MVC
Introduction to relational databases and MySQL
PDO Database Connections
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
Class07 PHP: loops MIS 3501 Jeremy Shafer Department of MIS
Class05 How to get data from a form
MySQL Backup, Transfer and Restore
HTML5 APIs MIS3502 Jeremy Shafer Department of MIS
PDO Revisited MIS 3502 Jeremy Shafer Department of MIS
Sending a text message (and more)
Form Validation (with jQuery, HTML5, and CSS)
Form Validation, Part 2 (with jQuery, HTML5, and CSS)
JavaScript and the DOM MIS 2402 Jeremy Shafer Department of MIS
Numbers, strings and dates in JavaScript
Sessions and cookies MIS 3501 Jeremy Shafer Department of MIS
MIS JavaScript and API Workshop (Part 3)
Introduction to AJAX and JSON
An Introduction to JavaScript
Programming Control Structures with JavaScript Part 2
Class11 Introduction to relational databases and MySQL
An introduction to jQuery
Loops and Arrays in JavaScript
JavaScript objects, functions, and events
Form Data (part 1) MIS3501 Jeremy Shafer Department of MIS
Introduction to JavaScript
An introduction to jQuery
ASP.NET MVC Web Development
Introduction to MIS3502 MIS 3502 Jeremy Shafer Department of MIS
PDO and Arrays MIS 3502 Jeremy Shafer Department of MIS
Programming Control Structures with JavaScript
An introduction to jQuery
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Sending a text message (and more)
Strings and Dates in JavaScript
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Presentation transcript:

MVC – Model View Controller MIS 3502 Jeremy Shafer Department of MIS Fox School of Business Temple University

Roadmap We are here. Part 2 JavaScript jQuery Part 1 MVC PDO Bootstrap Ajax, JSON APIs

Things that make me think of MVC

The MVC pattern The Controller: Act like a traffic cop… receive user input and decide what to do.

The MVC pattern The Model: talk to the database.

The MVC pattern The View: specifies what the user can see.

The MVC pattern SANITY CHECK! – In which of the above would you expect to see code that uses PDO syntax?

The MVC pattern SANITY CHECK! – In which of the above would you expect to see a lot of HTML?

The MVC pattern SANITY CHECK! – In which of the above would you expect to see a lot of if / else statements?

What about functions?

function function_name([parameter_list]) { // statements that are executed by the function return $some_result; }

Build a request response (with include) Here’s a good rule of thumb. Use include and exit within an application folder. Use header and exit to bounce the user from one application folder to another. Build a request response (with include) Redirect a request (with header) So… how do I know when to do one, or the other???

Let’s look at an example