ob_function() public static method

Calls a function with an output buffer. This is useful if you have a function that outputs text that you want to capture and use within a twig template.
public static ob_function ( callback $function, array $args = [null] ) : string
$function callback
$args array
return string
Beispiel #1
0
 /**
  *
  *
  * @return string
  */
 public function call()
 {
     $args = $this->_parse_args(func_get_args(), $this->_args);
     $callable = isset($this->_class) ? array($this->_class, $this->_function) : $this->_function;
     if ($this->_use_ob) {
         return Helper::ob_function($callable, $args);
     } else {
         return call_user_func_array($callable, $args);
     }
 }