[PHPTAL] Include templates

BuKoX poczta at bukox.pl
Sun Jun 10 20:51:06 CEST 2007


Joshua Paine pisze:

> You can do this:
> 
> <metal:block define-macro="mymacro">
> some text with <b>something bold</b>
> </metal:block>
> 
> <p>I would like to show you <metal:block use-macro="mymacro" />.</p>
> 
> Output (ignoring whitespace):
> 
> <p>I would like to show you some text with <b>something bold</b>.</p>

Ok. But my structure of my site is different. I have header.html:

<html metal:define-macro="header" />
<head>
   [...]
</head>
<body>
<div id="container">
   <div id="header">

and footer.html:

   <metal:block define-macro="footer">
   </div>
</div>
</body>
</html>
</metal:block>

I have main template:

<span metal:use-macro="header.html/header">
[... content of main template ...]
<span metal:use-macro="footer.html/footer">

I recieve exception in header.html that "Reached document end but 
element stack not empty in:27" - last line in header.html. It's strange 
becouse in Smarty it was very handy - I could include every template in 
every place independent of template structure.
How can include templates in this way?

bye...

-- 
  __               __       _______________________________________
|__\\ |  || |_// /  \\ \_//        Portfolio: http://bukox.pl     |
|__// |__|| | \\ \__// / \\__Total Commander: http://totalcmd.pl /



More information about the PHPTAL mailing list