|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
greatperson Smarty n00b
Joined: 19 May 2010 Posts: 1
|
Posted: Wed May 19, 2010 6:10 pm Post subject: A default filename for display() |
|
|
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 |
|
Andreyco Smarty n00b
Joined: 28 Jun 2010 Posts: 3
|
Posted: Sun Jul 04, 2010 10:48 am Post subject: |
|
|
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 |
|
Back to top |
|
|
|
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
|