TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

Passing as variable rather than using global

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Michael Frey
Date: 2014-07-09
Time: 13:20

Passing as variable rather than using global

Hi,

I have an existing Code Igniter project. If I wish to use TBS with this setup it means that I need to make all my variables and arrays globals.

Can I somehow rather pass variables into the Show and LoadTemplate functions? This would be much preferred to making everything global.

Thanks.
Michael
By: Skrol29
Date: 2014-07-09
Time: 14:11

Re: Passing as variable rather than using global

Hi,

Using global variables is the default behavior, that can be tuned.
See http://www.tinybutstrong.com/manual.php#php_varref