PHP Class Tools\View\Helper\TimelineHelper

You need to include your css and js file, manually: echo $this->Html->script('timeline/timeline'); echo $this->Html->css('/js/timeline/timeline');
Inheritance: extends Cake\View\Helper
Show file Open project: dereuromark/cakephp-tools Class Usage Examples

Public Properties

Property Type Description
$helpers array

Protected Properties

Property Type Description
$_defaultConfig array ..
$_items array

Public Methods

Method Description
addItem ( array $item ) : void Add timeline item.
addItems ( array $items ) : void Add timeline items as an array of items.
finalize ( boolean $return = false ) : void | string Finalize the timeline and write the javascript to the buffer.

Protected Methods

Method Description
_date ( DateTime | null $date = null ) : string Format date to JS code.
_format ( array $items ) : string Format items to JS code
_options ( array $options ) : string Format options to JS code

Method Details

_date() protected method

Format date to JS code.
protected _date ( DateTime | null $date = null ) : string
$date DateTime | null
return string

_format() protected method

Format items to JS code
See also: Tools\View\Helper\TimelineHelper::addItem()
protected _format ( array $items ) : string
$items array
return string

_options() protected method

Format options to JS code
protected _options ( array $options ) : string
$options array
return string

addItem() public method

Requires at least: - start (date or datetime) - content (string) Further data options: - end (date or datetime) - group (string) - className (string) - editable (boolean)
public addItem ( array $item ) : void
$item array
return void

addItems() public method

Add timeline items as an array of items.
See also: Tools\View\Helper\TimelineHelper::addItem()
public addItems ( array $items ) : void
$items array
return void

finalize() public method

Make sure that your view does also output the buffer at some place!
public finalize ( boolean $return = false ) : void | string
$return boolean If the output should be returned instead
return void | string Javascript if $return is true

Property Details

$_defaultConfig protected property

..
protected array $_defaultConfig
return array

$_items protected property

protected array $_items
return array

$helpers public property

public array $helpers
return array