SlideShare a Scribd company logo
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

More Related Content

What's hot

Debugging WordPress
Debugging WordPressDebugging WordPress
Debugging WordPress
Brecht Ryckaert
 
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
VCP 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 loop
VCP 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: Templates
Ke 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 Etsy
Mike Brittain
 
Introduction to Celery
Introduction to CeleryIntroduction to Celery
Introduction to Celery
Chathuranga Bandara
 
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
VCP 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 Notification
VCP 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 Ubuntu
VCP Muthukrishna
 

What's hot (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
 

Viewers also liked

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
Johan Hendriks
 
The Mark Of The Beast
The Mark Of The BeastThe Mark Of The Beast
The Mark Of The Beast
gwcoggins
 
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
Bahtiar Efendi
 
Atlas Graham Retail Products 2014
Atlas Graham Retail Products 2014Atlas Graham Retail Products 2014
Atlas Graham Retail Products 2014
jimigee64
 
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
ohdmoh
 
SEMMELROCK - pomysly na ogrod kostka brukowa
SEMMELROCK - pomysly na ogrod kostka brukowaSEMMELROCK - pomysly na ogrod kostka brukowa
SEMMELROCK - pomysly na ogrod kostka brukowa
Luskar - Z Nami Wybudujesz i Ogrzejesz
 
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-135
Fedegan
 
Shantanu Basu curriculum vita presentation
Shantanu Basu curriculum vita presentationShantanu Basu curriculum vita presentation
Shantanu Basu curriculum vita presentation
Shantanu Basu
 
Osmania University Mba syllabus 2013
Osmania University Mba syllabus 2013Osmania University Mba syllabus 2013
Osmania University Mba syllabus 2013
Osmania 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 Teamers
jasonjfrank
 
Facebook Bootcamp for PR
Facebook Bootcamp for PRFacebook Bootcamp for PR
Facebook Bootcamp for PR
nicole.landguth
 
Dan perron lim
Dan perron limDan perron lim
Dan perron lim
sdeconf
 
Declaraciones juradas
Declaraciones juradasDeclaraciones juradas
Declaraciones juradas
Mariano Manuel Bustos
 
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
Tony Terrones
 

Viewers also liked (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
 

Similar to Real

Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
Jussi Pohjolainen
 
Beginner guide to mysql command line
Beginner guide to mysql command lineBeginner guide to mysql command line
Beginner guide to mysql command line
Priti Solanki
 
Introduction To Lamp P2
Introduction To Lamp P2Introduction To Lamp P2
Introduction To Lamp P2
Amzad Hossain
 
PHP tips by a MYSQL DBA
PHP tips by a MYSQL DBAPHP tips by a MYSQL DBA
PHP tips by a MYSQL DBA
Amit Kumar Singh
 
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
Santiago 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 pfz
Joshua 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 Vanderkelen
NETWAYS
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance Issues
Odoo
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance Schema
Mark Leith
 
Fluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_publicFluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_public
Saewoong Lee
 
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
CloudStack - Open Source Cloud Computing Project
 
Php forum2015 tomas_final
Php forum2015 tomas_finalPhp forum2015 tomas_final
Php forum2015 tomas_final
Bertrand Matthelie
 
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
Chad Cooper
 
MongoDB user group israel May
MongoDB user group israel MayMongoDB user group israel May
MongoDB user group israel May
Alon 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, How
Karen Morton
 
Pro PostgreSQL
Pro PostgreSQLPro PostgreSQL
Pro PostgreSQL
Robert Treat
 
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
Sam Hennessy
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
Amin Uddin
 
Drizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free MigrationDrizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free Migration
Andrew Hutchings
 

Similar to 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
 

Recently uploaded

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 

Recently uploaded (20)

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 

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.