Re: [SMARTY-DEV] Documentation error (register_error())

From: Date: Wed, 31 Aug 2005 18:52:33 +0000
Subject: Re: [SMARTY-DEV] Documentation error (register_error())
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2773@lists.php.net to get a copy of this message
Fixed in CVS, thanks! Pieter Nobels wrote:
I found an error in the documentation of register_function(): http://smarty.php.net/manual/en/api.register.function.php The example givven (13-1) does not work: <?php $smarty->register_function('date_now', 'print_current_date'); function print_current_date($params, &$smarty) { if(empty($params['format'])) {
    $format = "%b %e, %Y";
                                  // PROBLEM:
                                  // Nothing gets returned
} else {
    $format = $params['format'];
    return strftime($format,time());
} } ?> A correct version would be: <?php $smarty->register_function('date_now', 'print_current_date'); function print_current_date($params, &$smarty) { if(empty($params['format'])) {
    $format = "%b %e, %Y";
} else {
    $format = $params['format'];
} return strftime($format,time()); } ?> I hope I posted this to the correct mailinglist, I couldn't fine a mailinglist specific to the docs. If not, please accept my apologies and direct me to the correct mailinglist. Thanks in advance.


« previous php.smarty.dev (#2773) next »