Update runtime-routing.md

This commit is contained in:
surgat
2014-11-25 15:53:06 +03:00
parent 87c002d5b3
commit 08e65958dd

View File

@ -578,19 +578,11 @@ We can create the following URL rule class to solve this problem.
```php ```php
namespace app\components; namespace app\components;
use yii\web\UrlRule; use yii\web\UrlRuleInterface;
use yii\base\Object;
class CarUrlRule extends UrlRule class CarUrlRule extends Object implements UrlRuleInterface
{ {
public $db = 'db';
public function init()
{
parent::init();
if ($this->name === null) {
$this->name = __CLASS__;
}
}
public function createUrl($manager, $route, $params) public function createUrl($manager, $route, $params)
{ {