Showing posts with label cakePHP. Show all posts
Showing posts with label cakePHP. Show all posts

Sunday, 6 April 2008

cakePHP database config

Ok this is cool.

For CakePHP, database configurations are saved in the app/config/database.php file. But notice each config is given a variable name. Any number of configs can be added in this file so that when you're working on a controller you can set the $useDbConfig variable equal to a string of the same name as your config array. Simple.

here's more info

CakePHP conventions

This page outlines CakePHP conventions.

An interesting and useful paragraph is the following:

The first function you write for a controller might be the index() function. When a request specifies a controller but not an action, the default CakePHP behavior is to render the index() function of that controller. For example, a request to http://www.example.com/apples/ maps to a call on the index() function of the ApplesController, where as http://www.example.com/apples/view maps to a call on the view() function of the ApplesController.


Notice visibility is also mentioned on the page but starting a function name with an underscore