Categories > TinyButStrong general >

Take a Define and pass it to 'Loadtemplate.'

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: sikkle
Date: 2007-06-23
Time: 16:05

Take a Define and pass it to 'Loadtemplate.'

Hi there,

I try to understand the basic of tinybutstrong, i'm at this moment realy realy impress.

Easy, fast, efficient and human readable.

So at this moment, i learn last time about mergefield, on each page i need to take some information from Define already created by my configuration files.

DEFINE('MY_URL', 'http://localhost/here/');
DEFINE('STYLE_DIR',  'assets/');

In my html :


<img src="{html_URL}{html_style}image.gif" width="1" height="17" alt="" />


Sode the code will be :

$TBS = new clsTinyButStrong ;

$TBS->Mergefield ('html_URL', 'MY_URL');
$TBS->Mergefield ('html_style', 'STYLE_DIR');


$TBS->LoadTemplate('hello.htm') ;
$TBS->Show() ;



Is it ok to do that ?

Thanks !



By: sikkle
Date: 2007-06-23
Time: 16:06

Delete one of two i made by mistake :)

Sorry about this.
By: TomH
Date: 2007-06-23
Time: 17:03

Re: Take a Define and pass it to 'Loadtemplate.'

First thing to do is load template before merging. Your testing will go easier then...
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('hello.htm') ;

$TBS->Mergefield ('html_URL', 'MY_URL');
$TBS->Mergefield ('html_style', 'STYLE_DIR');


$TBS->Show() ;
By: sikkle
Date: 2007-06-23
Time: 17:56

Re: Take a Define and pass it to 'Loadtemplate.'

I just want to take two minute to thanks you.

Thanks to this little community.