CodeIgniter Forums
Ask TinyButStrong, how to call a variable - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Ask TinyButStrong, how to call a variable (/showthread.php?tid=12203)



Ask TinyButStrong, how to call a variable - El Forum - 10-10-2008

[eluser]Unknown[/eluser]
hello,

Hi,

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

http://codeigniter.com/wiki/TinyButStrong_Template_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


Ask TinyButStrong, how to call a variable - El Forum - 12-30-2010

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


Ask TinyButStrong, how to call a variable - El Forum - 12-31-2010

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