PEAR is archived and read-only

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

Home » HTML » HTML_Template_Sigma » Bug #2620

HTML_Template_Sigma::get(), additional param

Details

Request #2620HTML_Template_Sigma::get(), additional param
Submitted2004-10-26 11:55 UTC
Fromdavid dot rech at gmail dot com
StatusWont fix
PackageHTML_Template_Sigma
PHP Version4.3.9
OSirrelevant
Roadmaps(Not assigned)

Comments

[2004-10-26 11:55 UTC] david dot rech at gmail dot com

Description:
------------
HTML_Template_Sigma::get() actually returns only parsed blocks.

I'd love to have an optional parameter to get also unparsed blocks i.e. for single-block editing in a textarea.

HTML_Template_Sigma property '_blocks' is marked private, so I guess it makes more sense to have the additional parameter here instead of accessing the private param to avoid trouble in future PHP5-only versions of HTML_Template_Sigma.

Alternativly, HTML_Template_Sigma::get() could accept both touched and parsed blocks, so calling touchBlock() would be a workaround. ATM it lacks of the latter.

[2004-10-28 14:07 UTC] xavier at wuug dot org

If you are trying to simply return/display a template with untouched blocks still intact, I think you can just do this at the LoadTemplateFile level...

mixed loadTemplateFile( string $filename, [boolean $removeUnknownVariables = true], [boolean $removeEmptyBlocks = true])

So if I understand your question correctly, you can simply call:
$sigma = new HTML_Template_Sigma("tpl/", "tpl/cache/");
$sigma->loadTemplateFile("test.tpl", TRUE, FALSE);
echo $sigma->get();

This will display unparsed blocks, although I think it will also return the HTML comment tags for the block boundaries but that doesn't really matter..