Esempio n. 1
0
 public function getDetailUrl($contextNavItemId = null)
 {
     if ($contextNavItemId) {
         return \cms\helpers\Url::toMenuItem($contextNavItemId, 'gallery/album/index', ['albumId' => $this->id, 'title' => \yii\helpers\Inflector::slug($this->title)]);
     }
     return \luya\helpers\Url::toManager('gallery/album/index', ['albumId' => $this->id, 'title' => \yii\helpers\Inflector::slug($this->title)]);
 }
Esempio n. 2
0
 public function getDetailUrl($contextNavItemId = null)
 {
     if ($contextNavItemId) {
         return \cms\helpers\Url::toMenuItem($contextNavItemId, 'news/default/detail', ['id' => $this->id, 'title' => \yii\helpers\Inflector::slug($this->title)]);
     }
     return \luya\helpers\Url::toManager('news/default/detail', ['id' => $this->id, 'title' => \yii\helpers\Inflector::slug($this->title)]);
 }
Esempio n. 3
0
 public function testToModule()
 {
     Yii::$app->request->baseUrl = '';
     Yii::$app->request->scriptUrl = '';
     $url = \cms\helpers\Url::toMenuItem(1, 'news/default/detail', ['id' => 1, 'title' => 'foo-bar']);
     $this->assertEquals('/1/foo-bar', $url);
 }