Hi,

is there a way to access the calling smarty object from withing a 
modifier callback function?

Regular smarty callback functions get passed a list of "parameters" of 
the function call as a first argument and a reference to the calling 
smarty object as a second argument.

function my_smary_func($params, &$smarty) {
    ...

     if (my_smarty_check_params($params, $allowed)) {
         return true;
     }

    $smarty->assign();
    ...
}


That way you can not only modify the smarty object but access properties 
   of the object. Two of them help me to generate error messages: 
$smarty->_current_line_no and $smarty->_current_file (btw. one should 
"make them public").

function my_smarty_check_params($params, $allowed, &$smarty) {
   ....
   if (...) {
      return sprintf("Error on %s %d", $smarty->_current_file, ...);
   }
   ...
}

Can I do something similar with modifiers, which seem to have this
format. Is there a way to access the calling smarty object?

function my_smarty_modifier($value, $option = '', ...) {
    ??? $smarty->... ???
}

Ulf


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to