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

Change {include file=''} to {include template=''}

 
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 -> General
View previous topic :: View next topic  
Author Message
Dice
Smarty Rookie


Joined: 11 May 2010
Posts: 14

PostPosted: Tue May 11, 2010 1:22 am    Post subject: Change {include file=''} to {include template=''} Reply with quote

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? Smile Again this is the only area that requires changes correct?

Thanks![/code]
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue May 11, 2010 1:27 am    Post subject: Reply with quote

Why not use a custom template resource?

http://www.smarty.net/manual/en/templates.from.elsewhere.php
Back to top
View user's profile Send private message Visit poster's website
Dice
Smarty Rookie


Joined: 11 May 2010
Posts: 14

PostPosted: Tue May 11, 2010 1:33 am    Post subject: Reply with quote

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
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue May 11, 2010 1:55 am    Post subject: Reply with quote

Why do you need to make changes to the compiler?
Back to top
View user's profile Send private message Visit poster's website
Dice
Smarty Rookie


Joined: 11 May 2010
Posts: 14

PostPosted: Tue May 11, 2010 4:13 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue May 11, 2010 1:21 pm    Post subject: Reply with quote

{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
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 -> General 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