vivekmarakana/yii2-timeline-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

vivekmarakana/yii2-timeline-widget

Composer 安装命令:

composer require vivekmarakana/yii2-timeline-widget

包简介

Timeline/Telemetry Widget for Yii2

README 文档

README

Total Downloads Monthly Downloads License

Timeline/Telemetry Widget for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist vivekmarakana/yii2-timeline-widget "*"

or add

"vivekmarakana/yii2-timeline-widget": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?php
    $items = [];
    foreach ($posts as $post) {
        $data = [];
        $data['title'] = $post->title;
        $data['date'] = \Yii::$app->formatter->asDate(date("Y-m-d H:i:s", strtotime('+330 minutes', strtotime($post->published_at))), 'php:d M,Y');
        $data['time'] = \Yii::$app->formatter->asDate(date("Y-m-d H:i:s", strtotime('+330 minutes', strtotime($post->published_at))), 'php:h:i A');
        $data['notes'] = $post->summary;

        if(!is_null($post->postedBy)) {
            $data['subtitle'] = "By {$post->postedBy->name} - {$post->postedBy->bio}";
        }

        $items[] = $data;
    }
    \vivekmarakana\widgets\Timeline::widget(['items' => $items]);
?>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-08