Grido\Components\Columns\Column::getValue PHP Method

getValue() protected method

protected getValue ( mixed $row ) : mixed
$row mixed
return mixed
    protected function getValue($row)
    {
        $column = $this->getColumn();
        if (is_string($column)) {
            return $this->grid->getProperty($row, Helpers::unformatColumnName($column));
        } elseif (is_callable($column)) {
            return call_user_func_array($column, [$row]);
        } else {
            throw new Exception('Column must be string or callback.');
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Returns cell prototype (<td> html tag).
  * @param mixed $row
  * @return \Nette\Utils\Html
  */
 public function getCellPrototype($row = NULL)
 {
     $td = parent::getCellPrototype($row);
     if ($this->isEditable() && $row !== NULL) {
         $td->data['grido-editable-value'] = $this->editableValueCallback === NULL ? parent::getValue($row) : callback($this->editableValueCallback)->invokeArgs(array($row, $this));
     }
     return $td;
 }