diff --git a/common/behaviors/NotifyBehavior.php b/common/behaviors/NotifyBehavior.php index 5e64293..c48a0f1 100644 --- a/common/behaviors/NotifyBehavior.php +++ b/common/behaviors/NotifyBehavior.php @@ -45,20 +45,11 @@ return false; } } - $url = ''; + $url = \Yii::$app->urlManager->getHostInfo(); if($model::className() == Product::className()) { - $url = Url::to([ - 'catalog/product', - 'product' => $model, - '#' => 'artbox-comment', - ], true); + $url .= '/product/'.$model->alias.'#artbox-comment'; } elseif($model::className() == Articles::className()) { - $url = Url::to([ - 'articles/show', - 'translit' => $model->translit, - 'id' => $model->id, - '#' => 'artbox-comment', - ], true); + $url .= '/blog/'.$model->translit.'#artbox-comment'; } $mailer = Mailer::widget([ 'type' => 'comment_notify', -- libgit2 0.21.4