CakePHP Framework Home: http://www.cakephp.org/
After downloading the project, the directory structure such as (using version: 1.1.19.6305)
Build a PHP environment where AppServ2.5.9 is used. Download Home http://www.appservnetwork.com/
Create a new database blog in MySQL and run the following SQL Wen Jianqu.
/**/ / * First , create our posts table: * /
CREATE TABLE Posts (
ID INT UNSIGNED auto_increment PRIMARY KEY ,
Title VARCHAR ( - ),
Body TEXT ,
Created DATETIME DEFAULT NULL ,
Modified DATETIME DEFAULT NULL
);
/**/ / * then insert some posts for testing: * /
INSERT into posts (title,body,created)
VALUES ( ' The title ' , ' This is the post body. ' , now ());
INSERT into posts (title,body,created)
VALUES ( ' A title once again ' , ' And the post body follows. ' , now ());
INSERT into posts (title,body,created)
VALUES ( ' Title strikes back ' , ' This is really exciting! not. ' , now ());
Modify the Project app/config/directory under Database.php.default file name database.php, and modify its configuration.
Modify the Apache httpd.conf file.
Apache2.2 version, directly delete the comments #LoadModule rewrite_modulemodules/mod_rewrite.so .
2.0 Previous versions, it is said to modify 2 places: LoadModule rewrite_module libexec/httpd/mod_rewrite.so and addmodule mod_rewrite.c
Add Model:
/app/models/post.php
Code:
PHP
require_once ('cake/app_model.php');
classPostextendsAppmodel {
Public $name = 'Post';
Public $validate = Array(
'title' =Valid_not_empty,
'Body' =Valid_not_empty
);
}
?>
http://www.bkjia.com/PHPjc/319633.html www.bkjia.com true http://www.bkjia.com/PHPjc/319633.html techarticle cakephp Framework homepage: http://www.cakephp.org/After downloading the project, the directory structure such as (using version: 1.1.19.6305) to build PHP environment, where the use of AppServ2.5.9. Download ...