Tuesday, 10 May 2011

First Attempt With CakePHP

Currently learning from the IBM tutorial:
Cook up Web sites fast with CakePHP, Part 1: Getting started

I am using easyphp, and is go to set up the new cake as a production installation.

Several important steps:
1. In httpd.conf, set document root to:
DocumentRoot "${path}/www/cakephp/app/webroot" 


2. Also in httpd.conf, also set document root directory to
Directory "${path}/www/cakephp/app/webroot" 
...
 AllowOverride All
...


3. Setting up the database configuration:
Copy and rename the "app/config/database.php.default" into "app/config/database.php" and edit accordingly.


4. Create a user model:
 Create the file as "app/model/user.php" (or whatever name, as long as know how to handle)


5. Create a register view:
Create the file as "app/views/users/register.ctp


6. Create a controller and register action:
Create the file as "app/controller/users_controller.php". 



7. Bake it:
Go to the url: "http://localhost/users/register". 

No comments: