Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

convert tpl to php

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
conors
Smarty n00b


Joined: 27 Oct 2017
Posts: 1

PostPosted: Fri Oct 27, 2017 1:45 pm    Post subject: convert tpl to php Reply with quote

Hi all,

Are there any tools available for converting smarty tpl files to regular php?
I've been looking around but can only seem to find things that convert php to tpl, not vice versa.

Thanks
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Fri Oct 27, 2017 4:16 pm    Post subject: Reply with quote

I am not aware of any tools.

You can rename template files to whatever you want. For example, foobarbaz.tpl to foobarbaz.php. Then, you will need to change the parameter in the Smarty call that displays or fetches the template.

The latest version of Smarty does not execute any PHP code that may be found in the template.

Once the template is compiled, you will find that this intermediate format is real PHP, but very likely in a format you will not be able to use.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Oct 27, 2017 6:46 pm    Post subject: Re: convert tpl to php Reply with quote

conors wrote:
Are there any tools available for converting smarty tpl files to regular php?
I've been looking around but can only seem to find things that convert php to tpl, not vice versa.

Why there should be one? What are you going to do with it?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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