Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN 6710 - Section A – TR 9:30-10:45 CRN 10570 – Section B – TR 5:30-6:45.

Similar presentations


Presentation on theme: "Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN 6710 - Section A – TR 9:30-10:45 CRN 10570 – Section B – TR 5:30-6:45."— Presentation transcript:

1 Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN 6710 - Section A – TR 9:30-10:45 CRN 10570 – Section B – TR 5:30-6:45

2 MVC MVC - Model, View, Controller “MVC is a software architectural pattern for implementing user interfaces” – Wikipedia This is basically an organizational structure for our code to produce an application The basic structure is general enough to allow usage for basically any application, while maintaining code organization that is easy to follow

3 Model The duty of the “model” is to store the data for the application This is where we will put code to interact with our database if we have one in our application

4 View The “view” is responsible for the output to the user This is where we build the application GUI In our applications, this is where the majority, if not all, of our HTML/CSS will go

5 Controller Finally, the “controller” brings the model and view together with all of our programming logic If the view is submitting data, the controller handles validating the data before giving it to the model If the view needs to be modified based on data retrieved from the model, the controller will take care of this step as well

6 MVC By separating the application into three distinct layers, it becomes easy to manipulate and work with the application from a development standpoint If we need to adjust the layout of content, we visit the views If we need to adjust the data included in the view, we visit the model If we need to modify the logic behind what data is presented, or send data from the view to the model, the controller handles these steps

7 MVC As we begin to consider building a web application, we can now break down our thinking process What screens do I want my user to interact with These will each be views in my application What data do I want to collect from my user, what data do I want to present to my user? This content will be designed into a series of data objects as models Finally, putting these together is done within our controllers

8 MVC Microsoft offers a MVC template in Visual Studio for building ASP.NET projects in the MVC structure Many other languages have templates to get you started as well In PHP, we are going to use the CodeIgniter framework, which is designed to be MVC compliant

9 CodeIgniter 1. Download CodeIgniter from CodeIgniter.com We will use version 3.x 2. Add System and Application folders to your server 1. The first option is to put the “system” folder, at the root of your web space (not accessible to the web) This gives you a way to use a single system folder for all of your CI projects, making upgrading easier 2. The second option is to put the system and application folder together where you want the site to go

10 CodeIgniter If you put the system folder at the root, and the application folder inside of your site, then we need to edit the index.php file Let’s quickly go through that file to see what it is doing, and make the change if needed Then we should be able to load up the default page in CI

11 CodeIgniter Basic View/Controller in CI

12 Reminders Lab 4 – MySQL – Due Oct 1 st Project 1 – Responsive Site – Due Oct 8 th

13 Next Time MVC/CodeIgniter More with Views/Controllers Database connection Set up our first model Next Week More with models Helpers/Libraries More built in CI libraries to make common tasks easier


Download ppt "Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN 6710 - Section A – TR 9:30-10:45 CRN 10570 – Section B – TR 5:30-6:45."

Similar presentations


Ads by Google