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 TABLEposts (
IDINTUNSIGNED auto_incrementPRIMARY KEY,
TitleVARCHAR( -),
BodyTEXT,
CreatedDATETIME DEFAULT NULL,
ModifiedDATETIME DEFAULT NULL
);
/**// * then insert some posts for testing: * /
INSERT intoposts (title,body,created)
VALUES ('The title', 'This is the post body.', now ());
INSERT intoposts (title,body,created)
VALUES ('A title once again', 'And the post body follows.', now ());
INSERT intoposts (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 of the, directly to the #loadmodule rewrite_modulemodules/mod_rewrite.so comments deleted can be.
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');
class Post extends Appmodel {
public $name = ' Post ';
public $validate = Array (
'title ' = valid_not_empty,
'body ' = valid_not_empty
);
}
?>
Current 1/2 Page 12 next page
The above describes the conquer cakephpphp in the Ruby on Rails frame 1th/2 page, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.