-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathreadme-template.txt
More file actions
81 lines (67 loc) · 2.46 KB
/
readme-template.txt
File metadata and controls
81 lines (67 loc) · 2.46 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--------------------------------------------------------------------------------
To fetch a template using template view helper:
<code>
$this->template($name);
</code>
'$name' parameter:
Full path to a template, suffix .phtml is required
'/full/path/to/template.phtml'
Path to a module template, suffix MUST be omitted
$module . ':path/to/template'
'path/to/template'
Path to a theme template, suffix MUST be omitted
'path/to/template'
Path to a component template, suffix MUST be omitted
$component . ':path/to/template'
To fetch a module template using templateModule view helper:
<code>
$this->templateModule($name, $module = null);
</code>
'$name' parameter:
Relative path to a module template, suffix MUST be omitted
'path/to/template'
'$module' parameter:
Module name, current module name will be used if omitted
To fetch a theme template using templateTheme view helper:
<code>
$this->templateTheme($name);
</code>
'$name' parameter:
Relative path to a template template, suffix MUST be omitted
'path/to/template'
To fetch a view component template using templateComponent view helper:
<code>
$this->templateComponent($name);
</code>
'$name' parameter:
Relative path to a view component inside system module, suffix MUST be omitted, currently only following components are available
'form'
'form-popup'
'form-vertical'
--------------------------------------------------------------------------------
Predefined variables
In theme templates:
* Set from Pi\View\Helper\Meta::assign()
sitename
slogan
locale
charset
adminmail
timezone_server
timezone_system
In module templates: NOTE - not complete for auto template
* Set from Pi\Mvc\View\Http\InjectTemplateListener::injectTemplate()
module - Module name
controller - Controller name
action - Action name
In block templates:
* Set from Pi\View\Helper\Block::renderBlock()
module - Block's module
route - Matched route, available for call $route->getParam('module');
--------------------------------------------------------------------------------
To assign variables to theme templates from controller action:
$this->view()->viewModel()->getRoot()->setVariables(array('var' => 'val'));
To assign variables to module templates from controller action:
$this->view()->assign(array('var' => 'val'));
Taiwen Jiang
October 18th, 2012