Ublaboo\DataGrid\Row::getItem PHP Method

getItem() public method

Get original item
public getItem ( ) : mixed
return mixed
    public function getItem()
    {
        return $this->item;
    }

Usage Example

示例#1
0
 /**
  * Render row item into template
  * @param  Row   $row
  * @return mixed
  */
 public function render(Row $row)
 {
     /**
      * Renderer function may be used
      */
     if ($renderer = $this->getRenderer()) {
         if (!$renderer->getConditionCallback()) {
             return call_user_func_array($renderer->getCallback(), [$row->getItem()]);
         }
         if (call_user_func_array($this->getRenderer(), [$row->getItem()])) {
             return call_user_func_array($renderer->getCallback(), [$row->getItem()]);
         }
     }
     $a = Html::el('a')->href($this->grid->getPresenter()->link($this->href, $this->getItemParams($row)));
     if ($this->icon) {
         $a->add(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon));
         if (strlen($this->name)) {
             $a->add(' ');
         }
     }
     $a->add($this->name);
     if ($this->title) {
         $a->title($this->title);
     }
     if ($this->class) {
         $a->class($this->class);
     }
     if ($confirm = $this->getConfirm($row)) {
         $a->data('confirm', $confirm);
     }
     return $a;
 }
All Usage Examples Of Ublaboo\DataGrid\Row::getItem