renderPartialFromFile / renderPartialFromSource¶
Render a named partial from a template file or source string.
renderPartialFromFile¶
Render a named partial from a template file.
Parameters¶
| Parameter | Type | Description |
|-----------|------|-------------|
| fileName | string | Template file name (without extension) |
| partialName | string | Name of the partial to render |
| contextObj | object | Variables to inject |
| options | object | Options including views directories |
Example¶
renderPartialFromSource¶
Render a named partial from a template source string.
Parameters¶
| Parameter | Type | Description |
|-----------|------|-------------|
| fileContent | string | Template source string |
| partialName | string | Name of the partial to render |
| contextObj | object | Variables to inject |
| options | object | Options |
| filePath | string? | Optional file path for error messages |