Back to ActionButton class

Method render

public string
render
(?int $value = null, ?int $row = null, array $options = [])
Render action button by item value.
Parameters
  • int|null $value Current value of this item.
  • int|null $row The row number of this item.
  • array $options The options to override group options.
Returns
  • string Rendered HTML.
Since
  • 4.0.0
-
  • \InvalidArgumentException
Class: ActionButton
Project: Joomla

Method render - Source code

/**
 * Render action button by item value.
 *
 * @param   integer|null  $value    Current value of this item.
 * @param   integer|null  $row      The row number of this item.
 * @param   array         $options  The options to override group options.
 *
 * @return  string  Rendered HTML.
 *
 * @since   4.0.0
 *
 * @throws  \InvalidArgumentException
 */
public function render(?int $value = null, ?int $row = null, array $options = []) : string
{
    $data = $this->getState($value) ?? $this->unknownState;
    $data = ArrayHelper::mergeRecursive($this->unknownState, $data, ['options' => $this->options->toArray()], ['options' => $options]);
    $data['row'] = $row;
    $data['icon'] = $this->fetchIconClass($data['icon']);
    return LayoutHelper::render($this->layout, $data);
}