forked from TYPO3/Fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_namespaces.php
More file actions
25 lines (20 loc) · 873 Bytes
/
example_namespaces.php
File metadata and controls
25 lines (20 loc) · 873 Bytes
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
<?php
/*
* EXAMPLE: Namespaces in Fluid templates
*
* How to import and use namespaces in Fluid.
*
* This example also shows how to import and alias
* namespaces in a manner suited for XSD-based
* autocompletion.
*/
require __DIR__ . '/include/view_init.php';
// 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/Namespaces.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);