Announcement

  •  » Engine
  •  » Is it possible to load template in PHP without parsing

#1 2015-03-05 04:35:44

Serge D
Member
US
2014-07-15
383

Is it possible to load template in PHP without parsing

I want to take advantage of template engine i.e. smarty but within my own code
idea is to be able to load TPL file located in Theme's templates folder from within some function (PHP) i.e. get template file content independently from global $template

I tried to

  $template->set_filenames( array('my_content'=>'my_content.tpl') );
  $myvar = $template->parse( 'my_content', true);

but got error that file is not found

I think I may be missing something like tell $template where to look

Offline

 

#2 2015-03-05 08:55:03

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Is it possible to load template in PHP without parsing

...independently from global $template

Can you tell us how do you build your $template variable (I suppose its not the global one) ?

Offline

 

#3 2015-03-06 06:55:21

Serge D
Member
US
2014-07-15
383

Re: Is it possible to load template in PHP without parsing

rvelices wrote:

...independently from global $template

Can you tell us how do you build your $template variable (I suppose its not the global one) ?

just used global $template before I make above calls

Last edited by Serge D (2015-03-11 20:08:58)

Offline

 
  •  » Engine
  •  » Is it possible to load template in PHP without parsing

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact