update biface local
This commit is contained in:
71
helpers/ListManagementGrid.php
Normal file
71
helpers/ListManagementGrid.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace app\helpers;
|
||||
|
||||
use Yii;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
|
||||
class ListManagementGrid {
|
||||
|
||||
static $path = "";
|
||||
|
||||
public static function path() {
|
||||
return self::$path;
|
||||
}
|
||||
|
||||
public static function engineNameFunc() {
|
||||
return function ($data) {
|
||||
return $data->app->app_name;
|
||||
};
|
||||
}
|
||||
|
||||
public static function getLayout() {
|
||||
return "{items}<div class='row'><div class='col-md-4'>{summary}</div><div class='col-md-8 text-right'>{pager}</div></div>";
|
||||
}
|
||||
|
||||
public static function actionTemplate() {
|
||||
return "{update} {delete}";
|
||||
}
|
||||
|
||||
public static function time() {
|
||||
return function($model) {
|
||||
return date("H:i:s d/m/Y", $model->time);
|
||||
};
|
||||
}
|
||||
|
||||
public static function birthday() {
|
||||
return function($model) {
|
||||
return date("d/m/Y", $model->birthday);
|
||||
};
|
||||
}
|
||||
|
||||
public static function image() {
|
||||
return function($model) {
|
||||
return Html::img("/BiFace/data/uploads/face/" . $model->image, [
|
||||
"class" => "img-thumbnail",
|
||||
"style" => "width: 150px;height:150px;"
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
||||
public static function type($typeArray) {
|
||||
return function($model) use ($typeArray) {
|
||||
return $typeArray[$model->type];
|
||||
};
|
||||
}
|
||||
|
||||
public static function rows() {
|
||||
return function($model, $index, $widget, $grid) {
|
||||
return [
|
||||
"ondblclick" => "_form(this);",
|
||||
"style" => "cursor: pointer;",
|
||||
"data" => [
|
||||
"id" => $model->id,
|
||||
"img" => "/BiFace/data/uploads/face/" . $model->image
|
||||
]
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user