custom function not implemented : documented
| From: | Francois Dumais | Date: | Fri, 28 Dec 2001 00:17:22 +0000 |
| Subject: | custom function not implemented : documented | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2394@lists.php.net to get a copy of this message | ||
The php file contains :
$smarty->register_function("cast_content", "cast_content");
Then, the Smarty.class.php file :
var $custom_funcs = array(
'html_options' => 'smarty_func_html_options',
'html_select_date' => 'smarty_func_html_select_date',
'html_select_time' => 'smarty_func_html_select_time',
'math' => 'smarty_func_math',
'fetch' => 'smarty_func_fetch',
'counter' => 'smarty_func_counter',
'assign' => 'smarty_func_assign',
'popup_init' => 'smarty_func_overlib_init',
'popup' => 'smarty_func_overlib',
'assign_debug_info' => 'smarty_func_assign_debug_info',
'cast_content' => 'smarty_func_cast_content'
);
Then the addons.php file:
function smarty_func_cast_content()
{
//$conf = new Config_File();
// Get all vars from a certain section
//$vars = $conf->get('./configs/table.conf');
// Get all sections
//$vars = $conf->get_section_names('./configs/table.conf');
}
Then the calling function test.tpl:
{cast_content}
The message:
Warning: Smarty: [in test.tpl line 9]: syntax error: custom function 'cast_content' is not
implemented in /usr/local/apache/htdocs/smarty/Smarty_Compiler.class.php on line 1181