Presentation is loading. Please wait.

Presentation is loading. Please wait.

School of Computing and Information Systems CS 371 Web Application Programming CakePHP Server-side Framework.

Similar presentations


Presentation on theme: "School of Computing and Information Systems CS 371 Web Application Programming CakePHP Server-side Framework."— Presentation transcript:

1 School of Computing and Information Systems CS 371 Web Application Programming CakePHP Server-side Framework

2 School of Computing and Information Systems CS 371 Web Application Programming Server-side Frameworks More than just a library Often they enforce a structured paradigm for better organization Remove some of the tedium of creating objects from database Rapid development

3 School of Computing and Information Systems CS 371 Web Application Programming CakePHP Enforces MVC architecture Based on PHP Similarities to Ruby-on-rails convention over configuration convention means naming conventions – ie stu, stuModel, stuController, view/stu, etc configuration means config files – lookup files to connect models to controllers, etc.

4 School of Computing and Information Systems CS 371 Web Application Programming Directory structure cake root app model controller View –app1 –app2 many other folders – only showing the main ones

5 School of Computing and Information Systems CS 371 Web Application Programming CakePHP Database drivers for mysql, oracle, postgres, etc. define database connection in a configuration file access to database is through model model def is very simple with common tasks built in think about writing an app to read a record from a table, delete a record, etc. now think about automating it

6 School of Computing and Information Systems CS 371 Web Application Programming Models you can create a model for each table override AppModel can also define relations hasOne – one to one hasMany – one to many belongsTo – many to one hasAndBelongsToMany

7 School of Computing and Information Systems CS 371 Web Application Programming Controller logic for user tasks, associated with a URL, e.g. www.soup.com/loginwww.soup.com/login define function for each task/url in the function define logic to connect the model data to the desired view use php and object provided by CakePHP d'oh

8 School of Computing and Information Systems CS 371 Web Application Programming View views are defined in ctp files in specific view directory (cakeRoot/app/view/myApp) use html, css, javascript, php forms for input/edit

9 School of Computing and Information Systems CS 371 Web Application Programming Set up (from tutorial) download to public_html and unzip it (rename it cake) create the database create cake/app/Config/database.php public $default = array( 'datasource' => 'Database/Mysql', 'persistent' => false, 'host' => 'cis.gvsu.edu', 'login' => 'yourMysqlLogin', 'password' => 'yourMysqlPassword', 'database' => 'yourLogin', 'prefix' => '', ); change the security strings in core.php make tmp web-writable


Download ppt "School of Computing and Information Systems CS 371 Web Application Programming CakePHP Server-side Framework."

Similar presentations


Ads by Google