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.
PHP includes - Remake it

 
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 419
Location: Kathmandu, Nepal

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?
_________________
Skype: pbimal
To hire instantly as a freelancer - https://www.odesk.com/o/profiles/users/_~~657b70cc7f2c616a/
Visit my website - http://bimal.org.np/ for more articles
800+ screenshots to learn about website mistakes: http://mistakes.sanjaal.com/
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7036
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: 419
Location: Kathmandu, Nepal

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.
_________________
Skype: pbimal
To hire instantly as a freelancer - https://www.odesk.com/o/profiles/users/_~~657b70cc7f2c616a/
Visit my website - http://bimal.org.np/ for more articles
800+ screenshots to learn about website mistakes: http://mistakes.sanjaal.com/
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    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