ajaxblog/rapidgrid
Composer 安装命令:
composer require ajaxblog/rapidgrid
包简介
关键字:
README 文档
README
Installation
The package can be installed via Composer by requiring the "ajaxblog/rapidgrid": "*" package in your project's composer.json.
{
"require": {
"philo/laravel-blade": "3.*",
"ajaxblog/rapidgrid": "*"
}
}
Usage
<?php include_once "vendor/autoload.php"; use \AjaxBlog\RapidGrid\DataGrid; use \AjaxBlog\RapidGrid\Column; use \AjaxBlog\RapidGrid\Header; $row = [[ "field1" => 10, "field2" => 11, "link" => rand(1, 100), "date" => "2015-10-15 10:14:56", "price" => rand(1000, 10000), "link" => "link/".rand(1000, 10000), ]]; use Illuminate\Database\Capsule\Manager as Capsule; $capsule = new Capsule; $capsule->addConnection([ 'driver' => 'mysql', 'host' => 'localhost', 'database' => '...', 'username' => '...', 'password' => '...', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ]); // Set the event dispatcher used by Eloquent models... (optional) use Illuminate\Events\Dispatcher; use Illuminate\Container\Container; $capsule->setEventDispatcher(new Dispatcher(new Container)); // Make this Capsule instance available globally via static methods... (optional) $capsule->setAsGlobal(); // Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher()) $capsule->bootEloquent(); $model = Capsule::table('model'); $views = __DIR__ . '/views'; $cache = __DIR__ . '/cache'; $blade = new \Philo\Blade\Blade($views, $cache); $model = new \AjaxBlog\RapidGrid\Criteria\Laravel($model); $grid = new DataGrid(table_name); $grid->setLimit(20); $column1 = Column\Sort::factory("id", "Id")->setHeaders([new Header\Check("id", [1=>1, 2=>2])]); $column2 = Column\Sort::factory("name", "Name")->setHeaders([new Header\Search("name")]); $grid->setColumns([ $column1, $column2, ]); $table = $blade->view()->make("grid", ["grid" => $grid])->render(); echo $blade->view()->make("page", ["table" => $table]);
统计信息
- 总下载量: 40
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-12-06
