Difference between #3 and #4 of
Using the configuration file, explain what can be configured.

Revision #4 has been created by rfenner on Jan 12, 2010, 8:25:29 PM with the memo:

Added stuff on using the controllerMap, scriptMap and aliases
« previous (#3) next (#5) »

Changes

Title unchanged

Using the configuration file, explain what can be configured.

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

Content changed

[...]
// name of application
// access it using Yii::app()->name
'name'=>'My website',

//
aliases to specify shortcuts for paths in your app or
 
      // perhaps to external resources for your app
 
      'aliases'=>array(
 
            'myExternalFramework'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'
 
            .DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'myexternalframework'
 
        ),
 
 
        //building on above for a controller in the external 
 
        //framework you can use the controller map to map the 
 
        //controller path
 
        'controllerMap'=>array('myController'=>'myExternalFramework.controllers.MyController'),
 
 
        //
default controller that will be executed when running the application
'defaultController'=>'site',
[...]
),
),
                // you can use the scriptMap to configure where your scripts come from. 
 
                //If you use the split configurations for development and production you can 
 
                // have different maps in each and then just load the file and it'll
 
                // load the appropriate file depending on the configuration your running.
 
                // for a production configuration you can have this
 
                'clientScript'=>array(
 
                      'scriptMap'=>array(
 
                          'register.js'=>'site.min.js',
 
                          'login.js'=>'site.min.js',
 
                      ),
 
                ),
 
                // for a development configuration you can have this
 
                'clientScript'=>array(
 
                      'scriptMap'=>array(
 
                          'register.js'=>'register.js',
 
                          'login.js'=>'login.js',
 
                      ),
 
                ),
 
), ); ?> ```
17 0
14 followers
Viewed: 92 298 times
Version: 1.1
Category: Tutorials
Tags:
Written by: atrandafir
Last updated by: Yang He
Created on: Jan 10, 2010
Last updated: 12 years ago
Update Article

Revisions

View all history