forked from TYPO3/Fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_escapingmodifier.php
26 lines (20 loc) · 1006 Bytes
/
example_escapingmodifier.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/*
* EXAMPLE: Use of escaping modifier
*
* This example shows how to use the `{escaping on|off|true|false}`
* modifier in templates. Using the modifier switches escaping off
* for the entire template file parsing.
*/
require __DIR__ . '/include/view_init.php';
// Assigning View variables: one variable containing HTML
$view->assign('html', '<strong>This is not escaped</strong>');
// Assigning the template path and filename to be rendered. Doing this overrides
// resolving normally done by the TemplatePaths and directly renders this file.
$view->getTemplatePaths()->setTemplatePathAndFilename(__DIR__ . '/Resources/Private/Singles/EscapingModifier.html');
// Rendering the View: we don't specify the optional `$action` parameter for the
// `render()` method - and internally, the View doesn't try to resolve an action
// name because an action is irrelevant when rendering a file directly.
$output = $view->render();
// Output using helper from view_init.php
example_output($output);