PEAR is archived and read-only

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

Home » HTML » HTML_Template_IT » Bug #2683

Can not parse templates containing no placeholders/blocks

Details

Request #2683Can not parse templates containing no placeholders/blocks
Submitted2004-11-04 00:04 UTC
Fromsomazx at shaw dot ca
Assignedpajoye
StatusBogus
PackageHTML_Template_IT
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2004-11-04 00:04 UTC] somazx at shaw dot ca

Description:
------------
Its common to want a graphic designer to modify templates as necessary for their purposes. Usually I will make the php code parse for a number of placeholder values likely to be needed by the graphic designer. On occasion the designer may not use any of these placeholders, or change their mind later in time to resume using some. Therefore I want the flexibility of parsing files which may/may not have empty placholders/blocks.

If you parse a template which contains no blocks/placeholders at all - then get/show methods will return null unless you turn on the flag to preserve empty blocks when you load the template. I'd reason this is because Template_IT treats the template (__global) as a block and strips it.

Its entirely possible though that you want empty blocks to be stripped - but preserve the contents of the __global block/template file and ::touchBlock doesn't work with __global.

Expected result:
----------------
return the contents of the template

[2004-11-04 00:21 UTC] somazx at shaw dot ca

Looking in IT.php source I notices __global__ being used and tried:

touchBlock('__global__')

and it worked. This approach allows for the functionality described above.

Using touchBlock('__global') returned this error:

Cannot find this block"__global'

[2004-11-05 12:53 UTC] pierre at dotgeek dot org

'__global__' is the default toplevel block.

--Pierre