I modified all Campsite PHP files to use $GLOBALS['g_campsiteDir'] as the
base path when generating file include paths. From now on please DO NOT use
$_SERVER['DOCUMENT_ROOT'] or $g_documentRoot variables. This is to make
Campsite directory independent.
does someone have an "best practice" for includes in smarty templates? My problem is that the {{ include file=some_file.tpl }} does not work right with relative filenames. We are developing template sets, which have an tree structure, and we like to rename the base folder without changing all include statements.
maybe to do the same thing but in the form of smarty custom plugin function
(using PHP require/include etc.). After that you can use some function like
{{ my_include file="some_file.tpl }} and it will work as you wish and will
be even a little bit faster, I guess. Just an idea, I didn't try to make it
this way.
Michal
|------------>
| From: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
|"Sebastian Goebel" |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
| |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
|06/17/2009 04:26 PM |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
|[campsite-dev] Best practice for template includes |
>------------------------------------------------------------------------------------------------------------------------------------------------|
Hi all,
does someone have an "best practice" for includes in smarty templates? My
problem is that the {{ include file=some_file.tpl }} does not work right
with relative filenames. We are developing template sets, which have an
tree structure, and we like to rename the base folder without changing all
include statements.