Re: custom function not implemented : documented

From: Date: Thu, 27 Dec 2001 21:25:28 +0000
Subject: Re: custom function not implemented : documented
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2395@lists.php.net to get a copy of this message
you need this: $smarty->register_function("cast_content", "smarty_func_cast_content"); > Francois Dumais wrote: > > 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 > > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to > $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.smarty.general (#2395) next »