Commit 08e65958 by surgat

Update runtime-routing.md

parent 87c002d5
......@@ -578,19 +578,11 @@ We can create the following URL rule class to solve this problem.
```php
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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment