forked from TYPO3/Fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_structures.php
34 lines (28 loc) · 1.06 KB
/
example_structures.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
27
28
29
30
31
32
33
34
<?php
/*
* EXAMPLE: Usage of syntax structures
*
* This example shows you how to use the structural
* helps that come with TYPO3.Fluid - such as conditions
* in various forms, switches, sections, etc.
*/
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/Structures.html');
$view->assign('dynamicSection', 'Dynamic');
$view->assign('notTrue', false);
$view->assign('notTrueEither', false);
$view->assign('butTrue', true);
$view->assign('switchValue', 3);
$view->assign('secondSwitchValue', 'b');
$view->assign('array', ['one', 'two', 'three']);
$view->assign('group', [
['property' => 'one'],
['property' => 'one'],
['property' => 'two']
]);
// Rendering the View: plain old rendering of single file, no bells and whistles.
$output = $view->render();
// Output using helper from view_init.php
example_output($output);