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

A default filename for display()

 
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
greatperson
Smarty n00b


Joined: 19 May 2010
Posts: 1

PostPosted: Wed May 19, 2010 6:10 pm    Post subject: A default filename for display() Reply with quote

Why doesn't Smarty use a default filename ("index.tpl" or something like this) when I don't specify any filename in the display() function? I think it would be very comfortable. This would make my code more clear when I use Smarty.

Of course, the default filename must be customizable, maybe as a constant in the Smarty object, like the template_dir etc.
Back to top
View user's profile Send private message Send e-mail
Andreyco
Smarty n00b


Joined: 28 Jun 2010
Posts: 3

PostPosted: Sun Jul 04, 2010 10:48 am    Post subject: Reply with quote

Open Smarry.class.php file and find this line
Code:
public function display($template, $cache_id = null, $compile_id = null, $parent = null)

Replace it with this code
Code:
public function display($template='index.tpl',$cache_id = null, $compile_id = null, $parent = null)

Now, you are allowed to make a call, such as this one
Code:
$smarty->display();


Hope, it is usefull for you Smile
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 -> 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