|
@@ 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-187 (lines=7) @@
|
| 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(['@category', 'last_category_id' => $id]); |
| 186 |
|
} |
| 187 |
|
break; |
| 188 |
|
case "product" : |
| 189 |
|
if (null !== $model = app\modules\shop\models\Product::findById($id)) { |
| 190 |
|
$dependency->tags [] = ActiveRecordHelper::getCommonTag(Product::className()); |
|
@@ 188-194 (lines=7) @@
|
| 185 |
|
$output = Url::to(['@category', 'last_category_id' => $id]); |
| 186 |
|
} |
| 187 |
|
break; |
| 188 |
|
case "product" : |
| 189 |
|
if (null !== $model = app\modules\shop\models\Product::findById($id)) { |
| 190 |
|
$dependency->tags [] = ActiveRecordHelper::getCommonTag(Product::className()); |
| 191 |
|
$dependency->tags [] = $model->objectTag(); |
| 192 |
|
$output = Url::to(['@product', 'model' => $model]); |
| 193 |
|
} |
| 194 |
|
break; |
| 195 |
|
} |
| 196 |
|
} |
| 197 |
|
return $output; |