Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // вверху
- use yii\web\HttpException;
- // метод
- public function actionView($id)
- {
- $model = $this->findModel($id);
- if (Yii::$app->user->id == $model->ManagerId) {
- return $this->render('view', ['model' => $model]);
- } else {
- Yii::$app->response->setStatusCode(403, 'Вам недоступен данный контакт так как вы не являетесь его владельцем.');
- return $this->render('viewError');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment