yii\base\Application::getUrlManager PHP Method

getUrlManager() public method

Returns the URL manager for this application.
public getUrlManager ( ) : UrlManager
return yii\web\UrlManager the URL manager for this application.
    public function getUrlManager()
    {
        return $this->get('urlManager');
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param \yii\base\Application $app
  */
 public function registerRules($app)
 {
     $app->getUrlManager()->addRules(['<language:\\w+\\-\\w+>/cp/' . $this->id => 'cp/' . $this->id, '<language:\\w+\\-\\w+>/cp/' . $this->id . '/<controller:\\w+>' => 'cp/' . $this->id . '/<controller>', '<language:\\w+\\-\\w+>/cp/' . $this->id . '/<controller:\\w+>/<action:\\w+>' => 'cp/' . $this->id . '/<controller>/<action>'], false);
     /**
      * magic/default/download.html?id=1
      * ru-RU/magic/default/download.html?id=1
      */
     $app->getUrlManager()->addRules([$this->id . '/<controller:\\w+>/<action:\\w+>' => $this->id . '/<controller>/<action>', '<language:\\w+\\-\\w+>/' . $this->id . '/<controller:\\w+>/<action:\\w+>' => $this->id . '/<controller>/<action>'], false);
 }
All Usage Examples Of yii\base\Application::getUrlManager