| 1 | <?php |
||
| 18 | class TemplateHandler extends BaseHandler |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | */ |
||
| 23 | public function renderPrepared(array $data) |
||
| 24 | { |
||
| 25 | return $this->getView()->render($this->template, $data); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function renderTemplate($data) |
||
| 29 | { |
||
| 30 | return $this->renderPrepared(self::prepareData($data)); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function prepareData($data) |
||
| 34 | { |
||
| 35 | return array_merge([ |
||
| 36 | 'app' => Yii::$app, |
||
| 37 | 'config' => Yii::$app, /// DEPRECATED |
||
| 38 | 'file' => $data->file, |
||
| 39 | 'handler' => $this, |
||
| 40 | ], parent::prepareData($data)); |
||
| 41 | } |
||
| 42 | |||
| 43 | 3 | public function existsTemplate() |
|
| 47 | } |
||
| 48 |