[pLog-general] Life Type + Smarty + register_function()

Ignacio Donati idonati at hotmail.com
Tue Aug 12 22:49:39 EDT 2008


Quick question to the wisdom of the community...  I am not very experience with objects, and I was wondering where will be the right place to define my own smarty functions...
 
My goal is to have something similar to the sample from the smarty documentation...:
 




<?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());}?> 
And in the template call the function...




{date_now}

{* or to format differently *}
{date_now format="%Y/%m/%d"}
 
but I am not sure how/where to connect the php part of the code... 
 
Any help is highly appreciated!!!
Thanks...
Ignacio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://limedaley.com/pipermail/plog-general/attachments/20080812/4b3b8479/attachment.htm>


More information about the pLog-general mailing list