Example #1
0
 /**
  * Pass a closure to this function in order to modify the output data
  * before it is json_encoded and sent to the client. The callable should
  * accept an array parameter, and return the modified array.
  * @param  callable $callable
  * @return null
  */
 public static function preDispatch($callable)
 {
     if (!is_callable($callable)) {
         throw new \InvalidArgumentException('PreDispatch callable must be callable');
     }
     self::$preDispatch = $callable;
 }
Example #2
0
 /**
  * Pass a closure to this function in order to modify the output data
  * before it is json_encoded and sent to the client. The callable should
  * accept an array parameter, and return the modified array.
  * @param  callable $callable
  * @return null
  */
 public static function preDispatch($callable)
 {
     if (!is_callable($callable)) {
         throw new \InvalidArgumentException(__t('predispatch_callable_must_be_callable'));
     }
     self::$preDispatch = $callable;
 }