Unformatted text preview:

Slide Number 1OverviewDesign PhilosophyServices ProvidedServices Provided (cont.)MVC ArchitectureSlide Number 7Straight PHPSymfonyReferences/Sourcessymfony In ActionPHP Web Application FrameworkLucas Greve, Eric Freese, Max Stein, Brandon Shelton• Aims to speed up web application development• Simplifies & separates: display code, data management, and business logic• Marketed towards enterprise development• Runs on most platforms• Includes framework & developer toolsOverviewDesign Philosophy Clean design and code readability Agile development principles such as DRY, KISS, and XP Web best practices and design patterns Focus on application logic not configuration− Convention over configuration—the developer needs to configure only the unconventional Simple to setup and use, but extensible.• Templates• AJAX• Actions provide business logic• Data abstraction & ORM– Database agnostic• Filters system• Extensible plug-in architectureServices Provided• Authentication system• Code generation tools– Admin generation• Built in unit & functional testingServices Provided (cont.)InternetsMVC ArchitecturebrowserserverController ViewModelrequest responseDBModel domain specificrepresentation of data/business logicView is the presentation layer, face of applicationController responds to user actions, changes model or view as necessary, is gluerequest responseMySQLFront ControllerActionView LogicLayoutTemplateDB AbstractionData AccessOracleInternet<?php// Connecting, selecting database$link = mysql_connect('localhost', 'myuser', 'mypassword');mysql_select_db('blog_db', $link);// Performing SQL query$result = mysql_query('SELECT date, title FROM post', $link);?><html><head><title>List of Posts</title></head><body><h1>List of Posts</h1><table><tr><th>Date</th><th>Title</th></tr><?php// Printing results in HTMLwhile ($row = mysql_fetch_array($result, MYSQL_ASSOC)){echo "\t<tr>\n";printf("\t\t<td> %s </td>\n", $row['date']);printf("\t\t<td> %s </td>\n", $row['title']);echo "\t</tr>\n";}?></table></body></html><?php// Closing connectionmysql_close($link);?>Straight PHP<html><head><title>List of Posts</title></head><body><h1>List of Posts</h1><table><tr><th>Date</th><th>Title</th></tr><?php foreach ($posts as $post): ?><tr><td><?php echo $post['date'] ?></td><td><?php echo $post['title'] ?></td></tr><?php endforeach; ?></table></body>Symfony<?php// Requiring the modelrequire_once('model.php');// Retrieving the list of posts$posts = getAllPosts();// Requiring the viewrequire('view.php');function getAllPosts(){…// Connecting to database// Performing SQL query// Filling up the array…$posts = array();while ($row = fetch_results($result)){$posts[] = $row;}return $posts;ViewControllerModelReferences/Sources The Definitive Guide to symfony. François Zaninotto, Fabien Potencier. Open Source. Symfony Project Website. http://www.symfony-project.org/ Learn symfony: a Beginners Tutorial. http://www.sitepoint.com/article/symfony-beginners-tutorial/. Symfonians: Another symfonyCommunity. http://symfonians.net/Demosymfony In


View Full Document

CU-Boulder CSCI 6448 - PHP Web Application Framework

Documents in this Course
Struts

Struts

12 pages

Adapter

Adapter

23 pages

Prototype

Prototype

16 pages

Weka

Weka

15 pages

qooxdoo

qooxdoo

16 pages

Django

Django

12 pages

Overview

Overview

22 pages

XNA

XNA

5 pages

Load more
Download PHP Web Application Framework
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view PHP Web Application Framework and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view PHP Web Application Framework 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?