[PHPTAL] Include templates

Joshua Paine lists at fairsky.us
Sun Jun 10 14:22:01 CEST 2007


[BuKoX] wrote:
> It's look like that every included template is validating separately.

It's not validating at all, but it is requiring well-formedness 
throughout, yes.

> It's very unhandy becouse in my opinion there 
> should be validation of whole template and not everyone separately.

Then you don't want an XML-based templating language. B/c of the nature 
of XML, it would be impossible for it to be otherwise. But, see below.

> Is there any other way to include templates which contains fragment
> of templates (not whole block)?

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>



<tal:block> and <metal:block> tags are dropped from output, but their 
content remains.

-- 
Joshua Paine
Chief Tower Builder
LetterBlock Software
http://letterblock.com/



More information about the PHPTAL mailing list