Welcome Guest, Not a member yet? Register   Sign In
Ask TinyButStrong, how to call a variable
#1

[eluser]Unknown[/eluser]
hello,

Hi,

i’m trying to implement the template engine TBS into CI reading this wiki article :

http://codeigniter.com/wiki/TinyButStron...te_Engine/

i want to ask how to call a variable like in the tbs manual.

while i'm try view :

Code:
$list = array('X','Y','Z') ;
$obj->tbswrapper->tbsMergeBlock("blk",$list);

in a template.html :
Code:
<table>
<tr><td>[blk.val;block=tr]</td></tr>
</table>

it's work,but while i'm try
Code:
$message = "hello";

in template.html
Code:
&lt;html&gt;
&lt;body&gt;
[var.message]
&lt;/body&gt;
&lt;/html&gt;
it's doesn't work, the error is :
Quote:TinyButStrong Error in field [var.message...] : the PHP global variable named 'message' does not exist or is not set yet. This message can be cancelled using parameter 'noerr'.

anybody can help me..?

note: sorry if my english is bad
#2

[eluser]Unknown[/eluser]
Make sure the variable is a global variable not a local variable (function, class).
#3

[eluser]Federico Baña[/eluser]
Make sure that tbswrapper uses $this->load->view(); so the vars are global




Theme © iAndrew 2016 - Forum software by © MyBB