1 | <?php |
||
19 | class TemplateHandler extends BaseHandler |
||
20 | { |
||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 5 | public function renderPrepared(array $data) |
|
25 | { |
||
26 | return $this->getView()->render($this->template, $data); |
||
27 | 5 | } |
|
28 | |||
29 | public function renderTemplate($data) |
||
30 | { |
||
31 | return $this->renderPrepared(self::prepareData($data)); |
||
32 | } |
||
33 | |||
34 | 5 | public function prepareData($data) |
|
35 | { |
||
36 | return array_merge([ |
||
37 | 5 | 'config' => Yii::$app->config, |
|
38 | 5 | 'this' => $this, |
|
39 | 5 | 'file' => $data->file, |
|
40 | ], parent::prepareData($data)); |
||
41 | } |
||
42 | |||
43 | public function existsTemplate() |
||
47 | } |
||
48 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.