Home » HTML » HTML_Template_Sigma » Bug #6908
variable value NULL & callback function
Details
| Submitted | 2006-02-23 16:29 UTC |
|---|---|
| From | hyzhak at gmail dot com |
| Status | Wont fix |
| Package | HTML_Template_Sigma |
| PHP Version | 5.1.2 |
| OS | FreeBSD |
| 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}">