Fully compile time includes

From: Date: Wed, 05 Oct 2005 22:05:53 +0000
Subject: Fully compile time includes
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2790@lists.php.net to get a copy of this message
Hi, I am writing templates that include lots of small standard .tpl files, all called from a set of ''top level'' templates. I am doing this for modularity & ease of maintaining consistency, I am not interested in passing these .tpl files special variables[**]. Many of these are less than 10 lines long, they are standard 'head', 'foot', 'standard_notices' & the such files. What smarty does is to compile these includes to a $this->_smarty_include(blah, blah) ie the top level template also on subsequent calls opens it, etc. What I want to achieve is that the contents of these small files are physically put into the compiled .php of the top level templates -- ie avoiding the extra work of opening the file. Perhaps some option to {include} might allow this or another verb like {include_static} or {include_paste} that just took the filename as an argument -- nothing else -- might be another way. I have looked at the smarty code -- it doesn't seem to be structured in a way that would make this easy ... unless someone is much smarter than I am (not at all difficult). Is this something that could be put into a future version of Smary, or is there already a way of achieving this ? Thanks in advance. [**] If I did want something: I would be happy to make it a global in the main template. -- Alain Williams Parliament Hill Computers Ltd. Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ #include <std_disclaimer.h>

« previous php.smarty.dev (#2790) next »