Commit 646c2160 authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлен класс обрабочтик для генерации шаблонов по заданным параметрам

parent 84965e22
<?php
namespace common\modules\messageTemplate\components;
use common\modules\messageTemplate\models\MessageTemplate;
use yii\web\NotFoundHttpException;
/**
* Class Templates
* @package common\modules\messageTemplate\components
*
* @property MessageTemplate $template
*/
class Templates {
protected $template;
/**
* @param $id
* @param array $values
* @throws \yii\web\NotFoundHttpException
*/
public function __construct($id, $values=array()){
/** @var MessageTemplate $model */
$model = MessageTemplate::findOne($id);
if ($model===null)
throw new NotFoundHttpException('The requested page does not exist.');
$this->template = $model->template;
$this->setValues($values);
}
protected function setValues($values) {
}
/**
* @return MessageTemplate
*/
public function getTemplate(){
return $this->template;
}
}
\ 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