SlideShare une entreprise Scribd logo
1  sur  32
Real World Web App Development(in 2 hours or less) GT College of Computing October 13, 2010 Jason Ardell Joshua Silver
What do we mean, “Real World”Web App Development?
What are we building?(Demo)
Who are we? Joshua Silver @1yellowbrick Joshua.silver@securehealthpay.com CS ‘09 Jason Ardell @ardell ardell@gmail.com CS ‘05
Our Toolkit Today
What is MVC and why use it?
http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/
InteractiveFollow along at:http://github.com/joshuasilver/RealWorldWebApp
Connect to Server You should have credentials http://dl.dropbox.com/u/5037034/gt.txt $> ssh root@[your.ip.address]   [enter password]
Connect to MySQL Once logged in, from Command line: # mysql -u cakephpuser -p cakephpdb Enter password:     <<  PASSWORD IS:  foo Welcome to the MySQL monitor.  Commands end with ; or . Your MySQL connection id is 183 Server version: 5.1.41-3ubuntu12.6-log (Ubuntu) Type 'help;' or '' for help. Type '' to clear the current input statement. mysql>
Setup DB cd /var/www/cakephp nano db_schema.sql (Be sure to use spaces, not tabs)
Make sure it worked mysql> source db_schema.sql mysql> show tables; +---------------------+ | Tables_in_cakephpdb | +---------------------+ | students            | +---------------------+ 1 row in set (0.00 sec) mysql> describe students; +--------------+------------------+------+-----+-------------------+----------------+ | Field        | Type             | Null | Key | Default           | Extra          | +--------------+------------------+------+-----+-------------------+----------------+ | id           | int(10) unsigned | NO   | PRI | NULL              | auto_increment | | first_name   | varchar(50)      | NO   |     | NULL              |                | | last_name    | varchar(50)      | NO   |     | NULL              |                | | phone_number | char(12)         | NO   |     | NULL              |                | | time_created | timestamp        | NO   |     | CURRENT_TIMESTAMP |                | +--------------+------------------+------+-----+-------------------+----------------+ 5 rows in set (0.01 sec)
Insert Fake Data cd /var/www/cakephp nano db_testdata.sql (Be sure to use spaces, not tabs)
Make sure it worked mysql> source db_testdata.sql mysql> select * from students; +----+------------+-----------+--------------+---------------------+ | id | first_name | last_name | phone_number | time_created        | +----+------------+-----------+--------------+---------------------+ |  1 | John       | Doe       | 678-555-0000 | 2010-10-13 16:08:22 | |  2 | Sally      | Smith     | 770-555-1234 | 2010-10-13 16:08:23 | +----+------------+-----------+--------------+---------------------+ 2 rows in set (0.00 sec)
Done with MySQLOver to CakePHP … its already installed cd /var/www/cakephp
Tour of CakePHP All we care about is: /app/models/ /app/views/ /app/controllers/
A few notes For automagic to work, you must name your files exactly to the spec. (case and spacing sensitive)
Create a student model # nano /var/www/cakephp/app/models/student.php <?php class Student extends AppModel { var $name = 'Student'; } // CakePHPautomagically completes the rest ?>
Create a student controller # nano /var/www/cakephp/app/controllers/students_controller.php <?php class StudentsController extends AppController {   var $name = 'Students';   function index() {    $this->set('studentList',  		$this->Student->find('all'));  } } ?>
Views Class name Method Names
Create student view folder # mkdir /var/www/cakephp/app/views/students
nano /var/www/cakephp/app/views/students/index.ctp root@gt-tutorial-jos <h1>Students</h1> <table>     <tr>         <th>Id</th>         <th>First Name</th>         <th>Last Name</th>         <th>Phone Number</th>         <th>Created</th>     </tr>     <!-- Here is where we loop through our $students array,  		printing out the students -->     <?phpforeach ($studentListas $student): ?>     <tr>         <td><?php echo $student['Student']['id']; ?></td>         <td><?php echo $student['Student']['first_name']; ?></td>         <td><?php echo $student['Student']['last_name']; ?></td>         <td><?php echo $student['Student']['phone_number']; ?></td>         <td><?php echo $student['Student']['time_created']; ?></td>     </tr>     <?phpendforeach; ?> </table> Add index view
http://{ip_address}/students/index Method Controller
Let’s figure out how to add a student 1.) Add new method called “add” to students_controller 2.) Make associated view 3.) Add link on homepage to add a student
nano /var/www/cakephp/app/controllers/students_controller.php <?php class StudentsController extends AppController { var $name = 'Students';     function index() {         $this->set('studentList', $this->Student->find('all'));     }     function add() {         if (!empty($this->data)) {             if ($this->Student->save($this->data)) {                 $this->Session->setFlash('Your student has been added.');                 $this->redirect(array('action' => 'index'));             }         }     }
Add view <h1>Add Student</h1> <?php     echo $form->create('Student');     echo $form->input('first_name');     echo $form->input('last_name');     echo $form->input('phone_number');     echo $form->end('Add Student'); ?>  <?php echo $html->link("Add Student", array('controller' => 'students', 'action' => 'add')); ?> Add link on homepage (index.ctp)
Twilio

Contenu connexe

Tendances

Windows PowerShell Basics - How To List PSDrive Info
Windows PowerShell Basics - How To List PSDrive InfoWindows PowerShell Basics - How To List PSDrive Info
Windows PowerShell Basics - How To List PSDrive InfoVCP Muthukrishna
 
Windows PowerShell Basics – How To Create powershell for loop
Windows PowerShell Basics – How To Create powershell for loopWindows PowerShell Basics – How To Create powershell for loop
Windows PowerShell Basics – How To Create powershell for loopVCP Muthukrishna
 
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: TemplatesKe Wei Louis
 
Web Performance Culture and Tools at Etsy
Web Performance Culture and Tools at EtsyWeb Performance Culture and Tools at Etsy
Web Performance Culture and Tools at EtsyMike Brittain
 
How To Create Power Shell Function Mandatory Parameter Value
How To Create Power Shell Function Mandatory Parameter ValueHow To Create Power Shell Function Mandatory Parameter Value
How To Create Power Shell Function Mandatory Parameter ValueVCP Muthukrishna
 
Bash Script - How To Monitor Application Error Logs and Send Notification
Bash Script - How To Monitor Application Error Logs and Send NotificationBash Script - How To Monitor Application Error Logs and Send Notification
Bash Script - How To Monitor Application Error Logs and Send NotificationVCP Muthukrishna
 
How To Install and Configure Open SSH Server on Ubuntu
How To Install and Configure Open SSH Server on UbuntuHow To Install and Configure Open SSH Server on Ubuntu
How To Install and Configure Open SSH Server on UbuntuVCP Muthukrishna
 

Tendances (9)

Debugging WordPress
Debugging WordPressDebugging WordPress
Debugging WordPress
 
Windows PowerShell Basics - How To List PSDrive Info
Windows PowerShell Basics - How To List PSDrive InfoWindows PowerShell Basics - How To List PSDrive Info
Windows PowerShell Basics - How To List PSDrive Info
 
Windows PowerShell Basics – How To Create powershell for loop
Windows PowerShell Basics – How To Create powershell for loopWindows PowerShell Basics – How To Create powershell for loop
Windows PowerShell Basics – How To Create powershell for loop
 
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
 
Web Performance Culture and Tools at Etsy
Web Performance Culture and Tools at EtsyWeb Performance Culture and Tools at Etsy
Web Performance Culture and Tools at Etsy
 
Introduction to Celery
Introduction to CeleryIntroduction to Celery
Introduction to Celery
 
How To Create Power Shell Function Mandatory Parameter Value
How To Create Power Shell Function Mandatory Parameter ValueHow To Create Power Shell Function Mandatory Parameter Value
How To Create Power Shell Function Mandatory Parameter Value
 
Bash Script - How To Monitor Application Error Logs and Send Notification
Bash Script - How To Monitor Application Error Logs and Send NotificationBash Script - How To Monitor Application Error Logs and Send Notification
Bash Script - How To Monitor Application Error Logs and Send Notification
 
How To Install and Configure Open SSH Server on Ubuntu
How To Install and Configure Open SSH Server on UbuntuHow To Install and Configure Open SSH Server on Ubuntu
How To Install and Configure Open SSH Server on Ubuntu
 

En vedette

STAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVE
STAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVESTAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVE
STAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVEJohan Hendriks
 
The Mark Of The Beast
The Mark Of The BeastThe Mark Of The Beast
The Mark Of The Beastgwcoggins
 
The simple past tense and future tense
The simple past tense and future tenseThe simple past tense and future tense
The simple past tense and future tenseBahtiar Efendi
 
Atlas Graham Retail Products 2014
Atlas Graham Retail Products 2014Atlas Graham Retail Products 2014
Atlas Graham Retail Products 2014jimigee64
 
4th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 2014
4th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 20144th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 2014
4th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 2014ohdmoh
 
Suelo pvc Tarkett Eclipse premium
 Suelo pvc Tarkett Eclipse premium  Suelo pvc Tarkett Eclipse premium
Suelo pvc Tarkett Eclipse premium Pavireli
 
Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135
Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135
Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135Fedegan
 
Shantanu Basu curriculum vita presentation
Shantanu Basu curriculum vita presentationShantanu Basu curriculum vita presentation
Shantanu Basu curriculum vita presentationShantanu Basu
 
Osmania University Mba syllabus 2013
Osmania University Mba syllabus 2013Osmania University Mba syllabus 2013
Osmania University Mba syllabus 2013Osmania University
 
Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...
Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...
Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...Perficient, Inc.
 
Go Hack Yourself - 10 Pen Test Tactics for Blue Teamers
Go Hack Yourself - 10 Pen Test Tactics for Blue TeamersGo Hack Yourself - 10 Pen Test Tactics for Blue Teamers
Go Hack Yourself - 10 Pen Test Tactics for Blue Teamersjasonjfrank
 
Facebook Bootcamp for PR
Facebook Bootcamp for PRFacebook Bootcamp for PR
Facebook Bootcamp for PRnicole.landguth
 
Dan perron lim
Dan perron limDan perron lim
Dan perron limsdeconf
 
XI Simposio Internacional de US en Miami
XI Simposio Internacional de US en MiamiXI Simposio Internacional de US en Miami
XI Simposio Internacional de US en MiamiTony Terrones
 

En vedette (17)

STAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVE
STAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVESTAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVE
STAND BY KT, GIN AND THE WORLD TOGETHER-WITH-LOVE
 
The Mark Of The Beast
The Mark Of The BeastThe Mark Of The Beast
The Mark Of The Beast
 
The simple past tense and future tense
The simple past tense and future tenseThe simple past tense and future tense
The simple past tense and future tense
 
Atlas Graham Retail Products 2014
Atlas Graham Retail Products 2014Atlas Graham Retail Products 2014
Atlas Graham Retail Products 2014
 
4th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 2014
4th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 20144th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 2014
4th Chinese-Asean Forum on Dentistry, Nanning China, October 27-28, 2014
 
SEMMELROCK - pomysly na ogrod kostka brukowa
SEMMELROCK - pomysly na ogrod kostka brukowaSEMMELROCK - pomysly na ogrod kostka brukowa
SEMMELROCK - pomysly na ogrod kostka brukowa
 
Suelo pvc Tarkett Eclipse premium
 Suelo pvc Tarkett Eclipse premium  Suelo pvc Tarkett Eclipse premium
Suelo pvc Tarkett Eclipse premium
 
Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135
Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135
Proyecto de-ley-para-el-sector-lácteo-carta-fedegan-135
 
Shantanu Basu curriculum vita presentation
Shantanu Basu curriculum vita presentationShantanu Basu curriculum vita presentation
Shantanu Basu curriculum vita presentation
 
Osmania University Mba syllabus 2013
Osmania University Mba syllabus 2013Osmania University Mba syllabus 2013
Osmania University Mba syllabus 2013
 
Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...
Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...
Leveraging Data in Financial Services to Meet Regulatory Requirements and Cre...
 
Go Hack Yourself - 10 Pen Test Tactics for Blue Teamers
Go Hack Yourself - 10 Pen Test Tactics for Blue TeamersGo Hack Yourself - 10 Pen Test Tactics for Blue Teamers
Go Hack Yourself - 10 Pen Test Tactics for Blue Teamers
 
Facebook Bootcamp for PR
Facebook Bootcamp for PRFacebook Bootcamp for PR
Facebook Bootcamp for PR
 
Dan perron lim
Dan perron limDan perron lim
Dan perron lim
 
Declaraciones juradas
Declaraciones juradasDeclaraciones juradas
Declaraciones juradas
 
Kimi 10
Kimi 10Kimi 10
Kimi 10
 
XI Simposio Internacional de US en Miami
XI Simposio Internacional de US en MiamiXI Simposio Internacional de US en Miami
XI Simposio Internacional de US en Miami
 

Similaire à Real

Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQLJussi Pohjolainen
 
Beginner guide to mysql command line
Beginner guide to mysql command lineBeginner guide to mysql command line
Beginner guide to mysql command linePriti Solanki
 
Introduction To Lamp P2
Introduction To Lamp P2Introduction To Lamp P2
Introduction To Lamp P2Amzad Hossain
 
Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Santiago Bassett
 
Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)ÇözümPARK
 
15 protips for mysql users pfz
15 protips for mysql users   pfz15 protips for mysql users   pfz
15 protips for mysql users pfzJoshua Thijssen
 
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert VanderkelenOSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert VanderkelenNETWAYS
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesOdoo
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaMark Leith
 
Fluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_publicFluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_publicSaewoong Lee
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinChad Cooper
 
MongoDB user group israel May
MongoDB user group israel MayMongoDB user group israel May
MongoDB user group israel MayAlon Horev
 
Performance Instrumentation for PL/SQL: When, Why, How
Performance Instrumentation for PL/SQL: When, Why, HowPerformance Instrumentation for PL/SQL: When, Why, How
Performance Instrumentation for PL/SQL: When, Why, HowKaren Morton
 
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job QueueTask Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job QueueSam Hennessy
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAmin Uddin
 
Drizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free MigrationDrizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free MigrationAndrew Hutchings
 

Similaire à Real (20)

Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
 
Beginner guide to mysql command line
Beginner guide to mysql command lineBeginner guide to mysql command line
Beginner guide to mysql command line
 
Introduction To Lamp P2
Introduction To Lamp P2Introduction To Lamp P2
Introduction To Lamp P2
 
PHP tips by a MYSQL DBA
PHP tips by a MYSQL DBAPHP tips by a MYSQL DBA
PHP tips by a MYSQL DBA
 
Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014
 
Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)
 
15 protips for mysql users pfz
15 protips for mysql users   pfz15 protips for mysql users   pfz
15 protips for mysql users pfz
 
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert VanderkelenOSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance Issues
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance Schema
 
Fluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_publicFluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_public
 
vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29
 
Php forum2015 tomas_final
Php forum2015 tomas_finalPhp forum2015 tomas_final
Php forum2015 tomas_final
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And Pythonwin
 
MongoDB user group israel May
MongoDB user group israel MayMongoDB user group israel May
MongoDB user group israel May
 
Performance Instrumentation for PL/SQL: When, Why, How
Performance Instrumentation for PL/SQL: When, Why, HowPerformance Instrumentation for PL/SQL: When, Why, How
Performance Instrumentation for PL/SQL: When, Why, How
 
Pro PostgreSQL
Pro PostgreSQLPro PostgreSQL
Pro PostgreSQL
 
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job QueueTask Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
 
Drizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free MigrationDrizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free Migration
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Real

  • 1.
  • 2. Real World Web App Development(in 2 hours or less) GT College of Computing October 13, 2010 Jason Ardell Joshua Silver
  • 3. What do we mean, “Real World”Web App Development?
  • 4. What are we building?(Demo)
  • 5. Who are we? Joshua Silver @1yellowbrick Joshua.silver@securehealthpay.com CS ‘09 Jason Ardell @ardell ardell@gmail.com CS ‘05
  • 6.
  • 8. What is MVC and why use it?
  • 11.
  • 12. Connect to Server You should have credentials http://dl.dropbox.com/u/5037034/gt.txt $> ssh root@[your.ip.address] [enter password]
  • 13. Connect to MySQL Once logged in, from Command line: # mysql -u cakephpuser -p cakephpdb Enter password: << PASSWORD IS: foo Welcome to the MySQL monitor. Commands end with ; or . Your MySQL connection id is 183 Server version: 5.1.41-3ubuntu12.6-log (Ubuntu) Type 'help;' or '' for help. Type '' to clear the current input statement. mysql>
  • 14. Setup DB cd /var/www/cakephp nano db_schema.sql (Be sure to use spaces, not tabs)
  • 15. Make sure it worked mysql> source db_schema.sql mysql> show tables; +---------------------+ | Tables_in_cakephpdb | +---------------------+ | students | +---------------------+ 1 row in set (0.00 sec) mysql> describe students; +--------------+------------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+------------------+------+-----+-------------------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | first_name | varchar(50) | NO | | NULL | | | last_name | varchar(50) | NO | | NULL | | | phone_number | char(12) | NO | | NULL | | | time_created | timestamp | NO | | CURRENT_TIMESTAMP | | +--------------+------------------+------+-----+-------------------+----------------+ 5 rows in set (0.01 sec)
  • 16. Insert Fake Data cd /var/www/cakephp nano db_testdata.sql (Be sure to use spaces, not tabs)
  • 17. Make sure it worked mysql> source db_testdata.sql mysql> select * from students; +----+------------+-----------+--------------+---------------------+ | id | first_name | last_name | phone_number | time_created | +----+------------+-----------+--------------+---------------------+ | 1 | John | Doe | 678-555-0000 | 2010-10-13 16:08:22 | | 2 | Sally | Smith | 770-555-1234 | 2010-10-13 16:08:23 | +----+------------+-----------+--------------+---------------------+ 2 rows in set (0.00 sec)
  • 18. Done with MySQLOver to CakePHP … its already installed cd /var/www/cakephp
  • 19. Tour of CakePHP All we care about is: /app/models/ /app/views/ /app/controllers/
  • 20. A few notes For automagic to work, you must name your files exactly to the spec. (case and spacing sensitive)
  • 21. Create a student model # nano /var/www/cakephp/app/models/student.php <?php class Student extends AppModel { var $name = 'Student'; } // CakePHPautomagically completes the rest ?>
  • 22. Create a student controller # nano /var/www/cakephp/app/controllers/students_controller.php <?php class StudentsController extends AppController {   var $name = 'Students';   function index() {    $this->set('studentList', $this->Student->find('all'));  } } ?>
  • 23. Views Class name Method Names
  • 24. Create student view folder # mkdir /var/www/cakephp/app/views/students
  • 25. nano /var/www/cakephp/app/views/students/index.ctp root@gt-tutorial-jos <h1>Students</h1> <table> <tr> <th>Id</th> <th>First Name</th> <th>Last Name</th> <th>Phone Number</th> <th>Created</th> </tr> <!-- Here is where we loop through our $students array, printing out the students --> <?phpforeach ($studentListas $student): ?> <tr> <td><?php echo $student['Student']['id']; ?></td> <td><?php echo $student['Student']['first_name']; ?></td> <td><?php echo $student['Student']['last_name']; ?></td> <td><?php echo $student['Student']['phone_number']; ?></td> <td><?php echo $student['Student']['time_created']; ?></td> </tr> <?phpendforeach; ?> </table> Add index view
  • 27.
  • 28. Let’s figure out how to add a student 1.) Add new method called “add” to students_controller 2.) Make associated view 3.) Add link on homepage to add a student
  • 29. nano /var/www/cakephp/app/controllers/students_controller.php <?php class StudentsController extends AppController { var $name = 'Students'; function index() { $this->set('studentList', $this->Student->find('all')); } function add() { if (!empty($this->data)) { if ($this->Student->save($this->data)) { $this->Session->setFlash('Your student has been added.'); $this->redirect(array('action' => 'index')); } } }
  • 30. Add view <h1>Add Student</h1> <?php echo $form->create('Student'); echo $form->input('first_name'); echo $form->input('last_name'); echo $form->input('phone_number'); echo $form->end('Add Student'); ?> <?php echo $html->link("Add Student", array('controller' => 'students', 'action' => 'add')); ?> Add link on homepage (index.ctp)
  • 31.