定制 michelmelo/laravel-gantt 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

michelmelo/laravel-gantt

最新稳定版本:1.0.2

Composer 安装命令:

composer require michelmelo/laravel-gantt

包简介

Laravel package to display items within a Gantt Chart.

README 文档

README

Installation

Require this package with composer:

composer require michelmelo/laravel-gantt

After updating composer, add the ServiceProvider to the providers array in config/app.php

MichelMelo\LaravelGantt\GanttServiceProvider::class,

Copy the package css file to your local css with the publish command:

php artisan vendor:publish --tag="gantt"

Usage

The model to display in the Gantt Chart will need to have properties of label, start and end at minimum.

  • label is the string to display for the item
  • start is a date or datetime (will need to pass this as a YYYY-MM-DD format)
  • end is a date or datetime (will need to pass this as a YYYY-MM-DD format)
/**
 *  You'll pass data as an array in this format:
    $test_array = [
                      [
                        'label' => 'The item title',
                          'date' => [
                             [
                                 'start' => '2016-10-08',
                                 'end'   => '2016-10-14',
                                 'class' => '',
                             ],
                             [
                                 'start' => '2016-10-16',
                                 'end'   => '2016-10-19',
                                 'class' => '',
                             ]
                         ]
 
                     ]
                 ];
 */
 
$gantt = new MichelMelo\LaravelGantt\Gantt($test_array, array(
    'title'      => 'Demo',
    'cellwidth'  => 25,
    'cellheight' => 35
));

return view('gantt')->with([ 'gantt' => $gantt ]);

Display in your view

In your view, add the gantt.css file:

<link href="/vendor/michelmelo/gantt/css/gantt.css" rel="stylesheet" type="text/css">

And then output the gantt HTML:

{!! $gantt !!}

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-21