%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php
namespace mdm\widgets;
use Yii;
use yii\helpers\Html;
use yii\base\Model;
/**
* Description of Column
*
* @author Misbahul D Munir <misbahuldmunir@gmail.com>
* @since 1.0
*/
class Column extends BaseObect
{
/**
* @var GridInput
*/
public $grid;
/**
*
* @var string|\Closure
*/
public $value;
/**
*
* @var string header text
*/
public $header;
/**
*
* @var string footer text
*/
public $footer;
/**
*
* @var array
*/
public $headerOptions = [];
/**
*
* @var array
*/
public $contentOptions = [];
/**
*
* @var array
*/
public $footerOptions = [];
/**
* @var string
*/
public $format;
/**
* Render header cell
* @return string
*/
public function renderHeaderCell()
{
return Html::tag('th', $this->header, $this->headerOptions);
}
/**
* Render footer cell
* @return string
*/
public function renderFooterCell()
{
return Html::tag('td', $this->footer, $this->footerOptions);
}
/**
* Render data cell
* @param Model $model model for cell
* @param string $key
* @param integer $index
* @return string
*/
public function renderDataCell($model, $key, $index)
{
if (is_callable($this->value)) {
$value = call_user_func($this->value, $model, $key, $index);
} else {
$value = $this->value;
}
if ($this->format !== null) {
$value = Yii::$app->getFormatter()->format($value, $this->format);
}
return Html::tag('td', $value, $this->contentOptions);
}
}