PHPackages                             mice-tm/yii2-timeline-widget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mice-tm/yii2-timeline-widget

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

mice-tm/yii2-timeline-widget
============================

A widget to render simple timeline

1.1.4(4y ago)09.8k↓33.3%3MITPHPPHP &gt;=7.1.0CI failing

Since Dec 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mice-tm/yii2-timeline-widget)[ Packagist](https://packagist.org/packages/mice-tm/yii2-timeline-widget)[ RSS](/packages/mice-tm-yii2-timeline-widget/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

Yii2 TimeLine Widget
====================

[](#yii2-timeline-widget)

[![Latest Version](https://camo.githubusercontent.com/07af9e6e30823b3f94a4876e1e3776d612066a741e629ed7cffaaabd2c98998f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6d6963652d746d2f796969322d74696d656c696e652d7769646765742e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/mice-tm/yii2-timeline-widget/releases)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Dependency Status](https://camo.githubusercontent.com/17cbd305a0b949761a5567aca8cb5323091774fed7a8e1edccf6f876807262a9/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3561323032353630306662323466303031386638633531372f62616467652e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/user/projects/5a2025600fb24f0018f8c517)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9b8ba8cea2df796b796d2239ca2f89d727f0b06dd6f8157ed581bbe8acceb45f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6963652d746d2f796969322d74696d656c696e652d7769646765742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mice-tm/yii2-timeline-widget/?branch=master)[![Build Status](https://camo.githubusercontent.com/ffff0e8ce968813a28fdfa0fef642e95e42a9ba2410ad46aa3392a9c46a3062c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6963652d746d2f796969322d74696d656c696e652d7769646765742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mice-tm/yii2-timeline-widget/build-status/master)[![Total Downloads](https://camo.githubusercontent.com/4831eac4c86aaf2d131013da72912e784775fb54b855420b1e46aa73a8df1d33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6963652d746d2f796969322d74696d656c696e652d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mice-tm/yii2-timeline-widget)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist mice-tm/yii2-timeline-widget "*"

```

or add

```
"mice-tm/yii2-timeline-widget": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Timeline widget expects array of LogModel-like models (micetm\\timeline\\LogModel) in `items`-param. Where `title` and `body` can contain macros strings in yii macros-format `{here-is-macros}`. With `eventIcons`-param you can extend or reassign icons for actions.

```
class LogModel extends Model
{

    public $action;
    public $title,
    public $body;
    public $log_date;
    public $macros;
    public $_id;

    public function rules()
    {
        return [
            [['action', 'title'], 'required'],
            [['action', 'title', 'body'], 'string'],
            ['log_date', 'integer'],
            ['macros', 'safe']
        ];
    }

    public function attributes()
    {
        return [
            '_id',
            'action',
            'title',
            'body',
            'macros',
            'log_date',
        ];
    }

    public function attributeLabels()
    {
        return [
            '_id' => '#',
            'action' => 'Action',
            'macros' => 'Macros',
            'title' => 'Title',
            'body' => 'Body',
            'log_date' => 'Date',
        ];
    }
}
```

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

```
