/** * Format text column cell * @param mixed $value * @param mixed $rowData * @return mixed|string */ public function render($value, $rowData) { $value = parent::render($value, $rowData); // Truncate content $value = $this->maxLength > 0 ? Strings::truncate($value, $this->maxLength) : $value; return $value; }
/** * Parse image file path * @param string $value * @param array $rowData * @return mixed|string * @throws \Nette\FileNotFoundException */ public function render($value, $rowData) { $value = parent::render($value, $rowData); $path = $this->getFilePath($value); // Set image source $img = Html::el('img'); $img->alt = $this->cellPrototype->getText() ? $this->cellPrototype->getText() : $this->labelPrototype->getText(); $img->src = $path; return $img; }