|
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 |
Dice Smarty Rookie
Joined: 11 May 2010 Posts: 14
|
Posted: Tue May 11, 2010 1:22 am Post subject: Change {include file=''} to {include template=''} |
|
|
Hey guys,
I'm currently looking at Smarty_Compiler.class.php
Lines 969-1045 refer to the {include} function. I've went ahead and made the changes and it seems like its working. However are there any other locations which actually look for 'file'?
For those wondering why I'm doing this. Well my template system is database driven, and I feel the word "file" may confuse some people.
EDIT: After further research I've found the following lines:
Code: |
case 'include':
return $this->_compile_include_tag($tag_args);
case 'include_php':
return $this->_compile_include_php_tag($tag_args);
|
I can change the word 'include' to something else too right? Again this is the only area that requires changes correct?
Thanks![/code] |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
|
Back to top |
|
Dice Smarty Rookie
Joined: 11 May 2010 Posts: 14
|
Posted: Tue May 11, 2010 1:33 am Post subject: |
|
|
mohrt wrote: | Why not use a custom template resource?
| Yup, I've already got this set up + have changed the default resource to db: so now i don't need to call db: when calling templates.
I've went ahead and made the changes from {include} to {get} and its working brilliantly. I must say this is a very very good system and is very customizable. Good job guys!
Will continue to search and see if there is any other sections which relate to {include} or file=''
If anybody is interested I can post my changes. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue May 11, 2010 1:55 am Post subject: |
|
|
Why do you need to make changes to the compiler? |
|
Back to top |
|
Dice Smarty Rookie
Joined: 11 May 2010 Posts: 14
|
Posted: Tue May 11, 2010 4:13 am Post subject: |
|
|
mohrt wrote: | Why do you need to make changes to the compiler? | Well since its database driven it doesn't make much sense to say include file, so it use easier terminology i use get template |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue May 11, 2010 1:21 pm Post subject: |
|
|
{include file="db:my.tpl"}
Gets the template from your db resource.
It makes no sense to change the tag terminology for each type of resource either. Every time you upgrade Smarty you will have to re-patch it. |
|
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
|