Smarty extends function