sensorario-url-route Create SEO URL with annotations

  1. Requirements
  2. Usage
  3. Resources

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

4 0
7 followers
547 downloads
Yii Version: 1.1
License: MIT
Category: Others
Developed by: sensorario
Created on: Dec 29, 2012
Last updated: 5 years ago

Downloads

show all

Related Extensions