app->app_name; }; } public static function getLayout() { return "{items}
{summary}
{pager}
"; } public static function actionTemplate() { return "{update} {delete}"; } public static function createdAt() { return function($model) { $common = new common(); return $common->formatTime($model->created_at, "H:i d/m/Y"); }; } public static function modifiedAt() { return function($model) { $common = new common(); return $common->formatTime($model->modified_at, "H:i d/m/Y"); }; } public static function update($obj) { return function($url, $model) use ($obj) { return Html::button("", [ 'class' => 'btn btn-success btn-xs', 'data' => ['toggle' => 'tooltip', 'href' => Url::to(['update', 'id' => $model->id])], 'title' => Yii::t('app', 'Chỉnh sửa'), 'onclick' => "common.form(this, '{$obj}');" ]); }; } public static function delete($deleteConfirmMess) { return function($url, $model) use ($deleteConfirmMess) { return Html::a('', ['delete', 'id' => $model->id], [ 'class' => 'btn btn-danger btn-xs', 'title' => Yii::t("app", "Xóa"), 'data' => [ 'toggle' => 'tooltip', 'confirm' => $deleteConfirmMess, 'method' => 'post' ] ]); }; } }