Nette\Utils\Callback::invokeArgs PHP Метод

invokeArgs() публичный статический Метод

Invokes callback with an array of parameters.
public static invokeArgs ( $callable, array $args = [] ) : mixed
$args array
Результат mixed
    public static function invokeArgs($callable, array $args = [])
    {
        self::check($callable);
        return call_user_func_array($callable, $args);
    }

Usage Example

Пример #1
0
 public function getBodyContent($data)
 {
     if (array_key_exists(self::CALLBACK, $this->option) === FALSE) {
         if (isset($data[$this->option[self::ID]]) === FALSE && is_null($data[$this->option[self::ID]]) === FALSE) {
             throw new Grid_Exception('Column ' . $this->option[self::ID] . ' does not exists in DataSource.');
         }
         $src = $data[$this->option[self::ID]];
     } else {
         $args = array($data);
         if (isset($this->option[self::CALLBACK_ARGS])) {
             if (!is_array($this->option[self::CALLBACK_ARGS])) {
                 throw new Grid_Exception(__CLASS__ . '::CALLBACK_ARGS must be an array. ' . gettype($this->option[self::CALLBACK_ARGS]) . ' given.');
             }
             $args = array_merge($args, $this->option[self::CALLBACK_ARGS]);
         }
         $src = Callback::invokeArgs($this->option[self::CALLBACK], $args);
     }
     $img = Html::el('img', array('src' => $src));
     if (isset($this->option[self::MAX_WIDTH]) === TRUE) {
         $img->style('max-width:' . $this->fixPixels($this->option[self::MAX_WIDTH]), TRUE);
     }
     if (isset($this->option[self::MAX_HEIGHT]) === TRUE) {
         $img->style('max-height:' . $this->fixPixels($this->option[self::MAX_HEIGHT]), TRUE);
     }
     return $img;
 }
All Usage Examples Of Nette\Utils\Callback::invokeArgs