@@ 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()); |
|
@@ 181-193 (lines=13) @@ | ||
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()); |
|
184 | $dependency->tags [] = $model->objectTag(); |
|
185 | $output = Url::to( |
|
186 | [ |
|
187 | '@category', |
|
188 | 'last_category_id' => $id, |
|
189 | 'category_group_id' => $model->category_group_id |
|
190 | ] |
|
191 | ); |
|
192 | } |
|
193 | break; |
|
194 | case "product" : |
|
195 | $product = Yii::$container->get(Product::class); |
|
196 | if (null !== $model = $product::findById($id)) { |