For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > December 2004 > Relative includes?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Relative includes?
Dieter Erdmann

2004-12-21, 8:58 am

Hi,

I'm having trouble with the Smarty include command. This is my directory
structure:

templates
subdir
A.tpl
inc.tpl

I want to include the file 'inc.tpl' in 'A.tpl'. Both files being in the same
directory, I would expect this to work in A.tpl:

{ include file="inc.tpl" }

However, this yields an error - 'inc.tpl' is not found. Instead, I have to
write:

{ include file="subdir/inc.tpl"; }

It seems that the include path is always relative to the 'templates' root
directory instead of the current directory (i.e. the directory of the current
template). Is there a way to get local includes working?

thx
Dieter
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com