Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- via 1) (ver pastebin) es para cuando quieres que tu URL principal caiga en un action especifico, ejemplo: http://misitioweb.com/
- a) edita config/main agregale 'defaultController'=>'otra',
- b) edita OtraController.php agregarle: 'defaultAction'=>'mia',
- eso hara que al visitar tu website automaticamente vaya a index.php?r=otra/mia
- via 2: (modo callback)
- cuando no quieres alterar a index.php, en cambio quieres que un usuario haga:
- http://misitioweb.com/otro-index.php el cual quieres que haga otro action.
- <?php
- // este archivo pudiera llamarse 'otro-index.php'
- //
- $yii=dirname(__FILE__).'/../../yii/framework/yii.php';
- $config=dirname(__FILE__).'/protected/config/main.php';
- defined('YII_DEBUG') or define('YII_DEBUG',false);
- defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
- $_GET['r'] = '/otra/mia'; // cuando tu usuario abre este archivo lanza este action
- require_once($yii);
- Yii::createWebApplication($config)->run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement