Class Renderer
Class for rendering email message.
Constants
- 
          
          stringTEMPLATE_FOLDER ¶'email'Constant for folder name containing email templates. 
Property Summary
- 
        $_viewBuilder protectedCake\View\ViewBuilder|nullThe view builder instance being used. 
Method Summary
- 
          __clone() publicClone ViewBuilder instance when renderer is cloned. 
- 
          __construct() publicConstructor 
- 
          createView() publicConstructs the view class instance based on the current configuration. 
- 
          render() publicRender text/HTML content. 
- 
          reset() publicReset view builder to defaults. 
- 
          set() publicSaves a variable or an associative array of variables for use inside a template. 
- 
          viewBuilder() publicGet the view builder being used. 
Method Detail
createView() ¶ public
createView(string|null $viewClass = null): Cake\View\ViewConstructs the view class instance based on the current configuration.
Parameters
- 
                string|null$viewClass optional
- Optional namespaced class name of the View class to instantiate. 
Returns
Cake\View\ViewThrows
Cake\View\Exception\MissingViewExceptionIf view class was not found.
render() ¶ public
render(string $content, list<string> $types = []): array<string, string>Render text/HTML content.
If there is no template set, the $content will be returned in a hash of the specified content types for the email.
Parameters
- 
                string$content
- The content. 
- 
                list<string>$types optional
- Content types to render. Valid array values are {@link Message::MESSAGE_HTML}, {@link Message::MESSAGE_TEXT}. 
Returns
array<string, string>The rendered content with "html" and/or "text" keys.
set() ¶ public
set(array|string $name, mixed $value = null): $thisSaves a variable or an associative array of variables for use inside a template.
Parameters
- 
                array|string$name
- A string or an array of data. 
- 
                mixed$value optional
- Value in case $name is a string (which then works as the key). Unused if $name is an associative array, otherwise serves as the values to $name's keys. 
Returns
$thisviewBuilder() ¶ public
viewBuilder(): Cake\View\ViewBuilderGet the view builder being used.
Returns
Cake\View\ViewBuilder