Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Get list of included template (.tpl) file names

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
sudaraka
Smarty n00b


Joined: 28 Jan 2010
Posts: 3

PostPosted: Thu Jan 28, 2010 12:52 pm    Post subject: Get list of included template (.tpl) file names Reply with quote

Hi all,

Does any one know if there's a way to get a names for all the template files used to create the final HTML output?

Like for example let's say I have mypage.tpl and it includes top.tpl and bottom.tpl and in top.tpl it includes head.tpl and menu.tpl
So after display or fetch, I need to get the list containing top.tpl, head.tpl, menu.tpl and bottom.tpl

Any ideas?

Thanks.
Back to top
View user's profile Send private message
sudaraka
Smarty n00b


Joined: 28 Jan 2010
Posts: 3

PostPosted: Mon Feb 08, 2010 1:27 am    Post subject: Solution found Reply with quote

Found a solution with my own research, please see details on EE question I posted. I will post the url below.

p.s
wonder why no one replied even after 50+ views Smile
anyway, contact me if anyone need more details on this.[/url]
Back to top
View user's profile Send private message
sudaraka
Smarty n00b


Joined: 28 Jan 2010
Posts: 3

PostPosted: Mon Feb 08, 2010 1:27 am    Post subject: EE Question with the final solution Reply with quote

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_25099675.html#26510341
Back to top
View user's profile Send private message
eithe
Smarty n00b


Joined: 15 Oct 2010
Posts: 4

PostPosted: Tue Aug 16, 2011 9:07 am    Post subject: Reply with quote

As I needed this as well here's the solution - all the templates are created using $Smarty->createTemplate function and stored in the $Smarty->template_objects array indexed by sha'd key. But, they are stored as objects, so you can either iterate by it, accessing either template_resource (the full path is accessible through template_filepath), or create an $Smarty->included_templates array and assign the templates to it as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP