Cake PHP - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Cake PHP

Description:

Framework for PHP developers. Free open source. Model View Controller Architecture ... PHP 4.3.2 or greater. Database engine, mySQL. XAMPP. Apache & mySql structure ... – PowerPoint PPT presentation

Number of Views:1834
Avg rating:3.0/5.0
Slides: 16
Provided by: Comp236
Category:
Tags: php | cake | php

less

Transcript and Presenter's Notes

Title: Cake PHP


1
Cake PHP
  • Matthew Concha

2
What is Cake?
  • Framework for PHP developers
  • Free open source
  • Model View Controller Architecture

3
MVC Architecture
  • Input - Processing - Output
  • Controller - Model - View

4
Steps
  • Download CakePHP at cakephp.org
  • Newest stable release vs. beta

5
Server Requirements
  • HTTP server, Apache
  • PHP 4.3.2 or greater
  • Database engine, mySQL

6
XAMPP
  • Apache mySql structure
  • Gives you development freedom
  • Fixed drive
  • Flash device

7
Testing
  • http//127.0.0.1
  • Put cake into folder
  • Add table data to database
  • Check data

8
mySQL query browser
mysql-gui-tools-5.0-r12-win32
9
Finally some CAKE?
  • Your database configuration file is present.
  • Cake is able to connect to the database.
  • http//127.0.0.1/cake/

10
Blog
Add post cake/posts/add Delete
cake/posts/delete Titles cake/posts/views/14
(uses id) as parameter
11
Models
  • It separates domain logic from the presentation,
    isolating application logic.

'Post' var validate array(
'title' VALID_NOT_EMPTY, 'body'
VALID_NOT_EMPTY ) ?
Post by default works with the posts table in
the database
12
Controllers
  • Talk to one specific model
  • PostsController contains functions of views.

class PostsController extends AppController
var name 'Posts' function index()
this-set('posts', this-Post-findAll()
)
13
Views
  • Thtml suffix

Blog posts html-link('Add Post', '/posts/add')
? Id
Title Created



html-link(post'Post''title',
'/posts/view/'.post'Post''id')?
link(
'Delete', "/posts/delete/post'P
ost''id'", null,
'Are you sure?' )?
post'Post''created' ?

14
Problems
  • Mod_rewrite URL rewriter, uncomment
  • Setting up passwords, login info
  • Refresh issues
  • Clear the cache
  • Stop/start database

15
References
  • http//www.cakephp.org
  • http//www.sourceforge.net/projects/xampp
  • http//dev.mysql.com/downloads/gui-tools
Write a Comment
User Comments (0)
About PowerShow.com