Executes a named rendering process by running each process step in sequence and aggregating
the results. The View class comes with 3 built-in processes: 'all', 'template', and
'element'. The 'all' process is the default two-step rendered view, where a template is
wrapped in a layout containing a header and footer.
public render ( string $process, array $data = [], array $options = [] ) : string | ||
$process | string | A named set of rendering steps defined in the `$_processes` array. |
$data | array | An associative array of data to be rendered in the set of templates. |
$options | array | Options used when rendering. Available keys are as follows: - `'type'` _string_: The type of content to render. Defaults to `'html'`. - `'layout'` _string_: The name of the layout to use in the default two-step rendering process. Defaults to `null`. - `'template'` _string_: The name of the template to render. Defaults to `null`. - `'context'` _array_: An associative array of information to inject into the rendering context. - `'paths'` _array_: A nested array of paths to use for rendering steps. The top-level keys should match the `'path'` key in a step configuration (i.e.: `'template'`, `'layout'`, or `'element'`), and the second level is an array of path template strings to search (can be a string if there's only one path). These path strings generally take the following form: `'{:library}/views/{:controller}/{:template}.{:type}.php'`. These template strings are specific to the `File` loader, but can take any form useful to the template loader being used. |
Résultat | string | Returns the result of the rendering process, typically by rendering a template first, then rendering a layout (using the default configuration of the `'all'` process). |