routes.php
Go to the documentation of this file.00001 <?php 00002 /* SVN FILE: $Id: cake_2console_2libs_2templates_2skel_2config_2routes_8php-source.html 580 2008-07-01 14:45:49Z gwoo $ */ 00003 /** 00004 * Short description for file. 00005 * 00006 * In this file, you set up routes to your controllers and their actions. 00007 * Routes are very important mechanism that allows you to freely connect 00008 * different urls to chosen controllers and their actions (functions). 00009 * 00010 * PHP versions 4 and 5 00011 * 00012 * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> 00013 * Copyright 2005-2008, Cake Software Foundation, Inc. 00014 * 1785 E. Sahara Avenue, Suite 490-204 00015 * Las Vegas, Nevada 89104 00016 * 00017 * Licensed under The MIT License 00018 * Redistributions of files must retain the above copyright notice. 00019 * 00020 * @filesource 00021 * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. 00022 * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project 00023 * @package cake 00024 * @subpackage cake.app.config 00025 * @since CakePHP(tm) v 0.2.9 00026 * @version $Revision: 580 $ 00027 * @modifiedby $LastChangedBy: gwoo $ 00028 * @lastmodified $Date: 2008-07-01 09:45:49 -0500 (Tue, 01 Jul 2008) $ 00029 * @license http://www.opensource.org/licenses/mit-license.php The MIT License 00030 */ 00031 /** 00032 * Here, we are connecting '/' (base path) to controller called 'Pages', 00033 * its action called 'display', and we pass a param to select the view file 00034 * to use (in this case, /app/views/pages/home.thtml)... 00035 */ 00036 Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); 00037 /** 00038 * ...and connect the rest of 'Pages' controller's urls. 00039 */ 00040 Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); 00041 /** 00042 * Then we connect url '/test' to our test controller. This is helpfull in 00043 * developement. 00044 */ 00045 Router::connect('/tests', array('controller' => 'tests', 'action' => 'index')); 00046 ?>