Merge pull request #6239 from surgat/patch-1

Update runtime-routing.md
This commit is contained in:
Qiang Xue
2014-11-25 10:39:01 -05:00

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)
{ {