| @@ 174-180 (lines=7) @@ | ||
| 171 | if (true === isset($m['objectName'], $m['objectId'])) { |
|
| 172 | $id = (int)$m['objectId']; |
|
| 173 | switch (strtolower($m['objectName'])) { |
|
| 174 | case "page" : |
|
| 175 | if (null !== $model = Page::findById($id)) { |
|
| 176 | $dependency->tags [] = ActiveRecordHelper::getCommonTag(Page::className()); |
|
| 177 | $dependency->tags [] = $model->objectTag(); |
|
| 178 | $output = Url::to(['@article', 'id' => $id]); |
|
| 179 | } |
|
| 180 | break; |
|
| 181 | case "category" : |
|
| 182 | if (null !== $model = Category::findById($id)) { |
|
| 183 | $dependency->tags [] = ActiveRecordHelper::getCommonTag(Category::className()); |
|
| @@ 195-207 (lines=13) @@ | ||
| 192 | ); |
|
| 193 | } |
|
| 194 | break; |
|
| 195 | case "product" : |
|
| 196 | if (null !== $model = app\modules\shop\models\Product::findById($id)) { |
|
| 197 | $dependency->tags [] = ActiveRecordHelper::getCommonTag(Product::className()); |
|
| 198 | $dependency->tags [] = $model->objectTag(); |
|
| 199 | $output = Url::to( |
|
| 200 | [ |
|
| 201 | '@product', |
|
| 202 | 'model' => $model, |
|
| 203 | 'category_group_id' => $model->getMainCategory()->category_group_id |
|
| 204 | ] |
|
| 205 | ); |
|
| 206 | } |
|
| 207 | break; |
|
| 208 | } |
|
| 209 | } |
|
| 210 | return $output; |
|