PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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}">