PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_Template_Flexy » Bug #7483

subtemplating support

Details

Request #7483subtemplating support
Submitted2006-04-25 10:56 UTC
Fromanil at m3 dot net
Assignedalan_k
StatusClosed
PackageHTML_Template_Flexy
PHP Version5.0.4
OSLinux Fedora Core 4
Roadmaps(Not assigned)

Comments

[2006-04-25 10:56 UTC] anil at m3 dot net

Description:
------------
Similar to Request #4405, this patch provides better subtemplating support. Adds a new 'partial' tag to the flexy:xxx namespace and allows for variable mapping to the new template. The word 'partial' is borrowed from the <a href="http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html">ERB</a> templating engine (ruby). You can define variables in the subtemplate context as attributes of the new tag. This feature is pretty important for modularising templates.

Changes were made on Flexy v1.2.1.

Test script:
---------------
Usage example:

<flexy:partial src="subtemplate.html" varNameInSubtemplateScope1="#String Literal#" varNameInSubtemplateScope2="currentPage.varName" varNameInSubtemplateScope3="var" />

Changeset:

A function is added to Compiler/Flexy/Flexy.php to handle the new flexy:partial tag. You can view the function here:

http://www.quotesque.net/archives/HTML_Template_Flexy_Partial_Tag.txt

[2006-09-08 12:39 UTC] monique dot szpak at m3 dot net

flexy:ignore loses state when partial is parsed.

This is probably correct behaviour but very confusing.

You need to redeclare flexy:ignore="yes" at some place (a wrapper element) in the partial.

Took us a while to figure that one out. :D