Commit e94951eb authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлен метод возвращающий запись по id

parent 027eb80f
......@@ -12,6 +12,7 @@ use Yii;
use common\components\AdminController;
use common\modules\messageTemplate\models\MessageTemplate;
use yii\data\ActiveDataProvider;
use yii\web\NotFoundHttpException;
class TemplateAdminController extends AdminController {
......@@ -60,4 +61,18 @@ class TemplateAdminController extends AdminController {
]
);
}
/**
* @param $id
* @return null|MessageTemplate
* @throws NotFoundHttpException
*/
protected function findModel($id)
{
if (($model = MessageTemplate::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment