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 #6908

variable value NULL & callback function

Details

Submitted2006-02-23 16:29 UTC
Fromhyzhak at gmail dot com
StatusWont fix
PackageHTML_Template_Sigma
PHP Version5.1.2
OSFreeBSD
Roadmaps(Not assigned)

Comments

[2006-02-23 16:29 UTC] hyzhak at gmail dot com

Description:
------------
if variable value is NULL that into callback function is transferred {varname} ...

Test script:
---------------
<?
require_once 'HTML/Template/Sigma.php';
$tmpl =& new HTML_Template_Sigma('./templates');
$tmpl -> setCallbackFunction('f', 'html_figure');
$tmpl -> loadTemplatefile("test.inc",true,true);
$tmpl -> setVariable('test_value', null);
echo $tmpl -> get();

function html_figure ($item) {
$from_a = array('{','}');
$to_a = array('{','}');
return str_replace($from_a, $to_a, $item);
}
?>

TEMPLATE FILE test.inc

<input type="text" value="{test_value}">

Expected result:
----------------
<input type="text" value="">

Actual result:
--------------
<input type="text" value="{test_value}">