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

PHP includes - Remake it

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Sat Mar 14, 2009 4:58 am    Post subject: PHP includes - Remake it Reply with quote

Instead of having two different tags
{include} and {include_php}, it would nice to merge them.

For example:
{incude file='...'} is a simple template include.
{include file='...' php=true} would do parsing a .php file as by {include_php}.

Plus, there should be a better validator, that should know, if an incuded file is a real php or not.

I love writing slim codes; and thus asked to throw {include_php} away.
And, is there a general idea to know, how many people use this tag?
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Sat Mar 14, 2009 3:54 pm    Post subject: Reply with quote

Smarty 3 will allow php template resources, which are not compiled:

{include file="php:foo.php"}
Back to top
View user's profile Send private message Visit poster's website
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Sat Mar 14, 2009 6:15 pm    Post subject: This is also good. Reply with quote

This is also good.

I have a feelings that for a true template engine implemenation, we may have to rarely bother about parsing template files.

It was my unfortue to me that I happened to learn {php} tags instead of other features, and first year of my Smarty was too poor.

These days, I never think of parsing php files or writing inline php codes in a template.
Back to top
View user's profile Send private message Visit poster's website
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 -> Feature Requests 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