1 | <?php |
||
26 | class Composer extends Object |
||
|
|||
27 | { |
||
28 | /** |
||
29 | * @var string|bool HTML layout view name. |
||
30 | * See [[Template::$htmlLayout]] for detailed documentation. |
||
31 | */ |
||
32 | public $htmlLayout = 'layouts/html'; |
||
33 | /** |
||
34 | * @var string|bool text layout view name. |
||
35 | * See [[Template::$textLayout]] for detailed documentation. |
||
36 | */ |
||
37 | public $textLayout = 'layouts/text'; |
||
38 | /** |
||
39 | * @var array the configuration that should be applied to any newly created message template. |
||
40 | */ |
||
41 | public $templateConfig = []; |
||
42 | |||
43 | /** |
||
44 | * @var \yii\base\View|array view instance or its array configuration. |
||
45 | */ |
||
46 | private $_view = []; |
||
47 | /** |
||
48 | * @var string the directory containing view files for composing mail messages. |
||
49 | */ |
||
50 | private $_viewPath; |
||
51 | |||
52 | |||
53 | /** |
||
54 | * @return string the directory that contains the view files for composing mail messages |
||
55 | * Defaults to '@app/mail'. |
||
56 | */ |
||
57 | 2 | public function getViewPath() |
|
64 | |||
65 | /** |
||
66 | * @param string $path the directory that contains the view files for composing mail messages |
||
67 | * This can be specified as an absolute path or a path alias. |
||
68 | */ |
||
69 | 2 | public function setViewPath($path) |
|
73 | |||
74 | /** |
||
75 | * @param array|\yii\base\View $view view instance or its array configuration that will be used to |
||
76 | * render message bodies. |
||
77 | * @throws InvalidConfigException on invalid argument. |
||
78 | */ |
||
79 | 1 | public function setView($view) |
|
86 | |||
87 | /** |
||
88 | * @return \yii\base\View view instance. |
||
89 | */ |
||
90 | 4 | public function getView() |
|
98 | |||
99 | /** |
||
100 | * Creates view instance from given configuration. |
||
101 | * @param array $config view configuration. |
||
102 | * @return \yii\base\View view instance. |
||
103 | */ |
||
104 | 4 | protected function createView(array $config) |
|
112 | |||
113 | /** |
||
114 | * Creates new message view template. |
||
115 | * The newly created instance will be initialized with the configuration specified by [[templateConfig]]. |
||
116 | * @param string|array $viewName view name for the template. |
||
117 | * @return Template message template instance. |
||
118 | * @throws InvalidConfigException if the [[templateConfig]] is invalid. |
||
119 | */ |
||
120 | 2 | protected function createTemplate($viewName) |
|
137 | |||
138 | /** |
||
139 | * @param MessageInterface $message the message to be composed. |
||
140 | * @param string|array $view the view to be used for rendering the message body. This can be: |
||
141 | * |
||
142 | * - a string, which represents the view name or path alias for rendering the HTML body of the email. |
||
143 | * In this case, the text body will be generated by applying `strip_tags()` to the HTML body. |
||
144 | * - an array with 'html' and/or 'text' elements. The 'html' element refers to the view name or path alias |
||
145 | * for rendering the HTML body, while 'text' element is for rendering the text body. For example, |
||
146 | * `['html' => 'contact-html', 'text' => 'contact-text']`. |
||
147 | * |
||
148 | * @param array $params the parameters (name-value pairs) that will be extracted and made available in the view file. |
||
149 | */ |
||
150 | 1 | public function compose($message, $view, array $params = []) |
|
154 | } |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.