Yii 1.1: sensorario-url-route

Create SEO URL with annotations
8 followers

With this module, you can rewrite url simply editing comments on your actions. For Example you can convert "index.php/site/index" in "/homepage" in this way:

class SiteController {
    /**
     * @Route(name="homepage");
     */
    public function actionIndex()
    {
        $this->render('index');
    }
}

Requirements

Yii 1.1 or above

Usage

First of all you need to download SensorarioUrlRoute and put it in modules folder. Then edit your config file

'modules' => array(
        'SensorarioUrlRoute',
        ...
    ),

Also, remeber to set urlManager:

// application components
    'components' => array(
        ...
        'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => require __DIR__ . '/../modules/SensorarioUrlRoute/routing.php',
        ),
        ...
    ),

To generate url using anotations go to index.php/SensorarioUrlRoute and generate or erase all your SEO frendly url =). All routes will be stored in a particular array and just included in config file.

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension