File: api-get-template-vars.md

package info (click to toggle)
smarty4 4.5.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,136 kB
  • sloc: php: 18,847; yacc: 986; makefile: 48; sh: 12
file content (37 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (2)
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
getTemplateVars()

returns assigned variable value(s)

Description
===========

array

getTemplateVars

string

varname

If no parameter is given, an array of all [assigned](#api.assign)
variables are returned.


    <?php
    // get assigned template var 'foo'
    $myVar = $smarty->getTemplateVars('foo');

    // get all assigned template vars
    $all_tpl_vars = $smarty->getTemplateVars();

    // take a look at them
    print_r($all_tpl_vars);
    ?>

       

See also [`assign()`](#api.assign),
[`{assign}`](#language.function.assign), [`append()`](#api.append),
[`clearAssign()`](#api.clear.assign),
[`clearAllAssign()`](#api.clear.all.assign) and
[`getConfigVars()`](#api.get.config.vars)