Fully compile time includes
[email protected] (Alain Williams) Wed, 5 Oct 2005 23:05:53 +0100
| Newsgroups | php.smarty.dev |
|---|---|
| Organization | Parliament Hill Computers Ltd |
| Message-ID | <[email protected]> |
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>
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDRE5BikkW5JBhACYRAiuDAKCPOJz1mIsRWIb++xcmtts+GpM3XQCfaMcH ErpPAegKp5Kg1VidQDMFW7A= =28lx -----END PGP SIGNATURE-----