Timeline Class

class Timeline

Represents a Timeline diagram

addPeriod(Period ...$period)

Add period(s)

Parameters:
  • ...$period (Period) – The period(s)

Returns:

A new instance of Timeline with the period(s) added

Return type:

Timeline

addSection(Section ...$section)

Add section(s)

Parameters:
  • ...$section (Section) – The section(s)

Returns:

A new instance of Timeline with the section(s) added

Return type:

Timeline

render(array $attributes)

Render the Mermaid code enclosed in a <pre> tag

Parameters:
  • $attributes (array) – HTML attributes for the enclosing <pre> tag

Returns:

Mermaid code enclosed in a <pre> tag

Return type:

string

withComment(string $comment)

Set a comment

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of Timeline with the comment

Return type:

Timeline

withPeriod(Period ...$period)

Set period(s)

Parameters:
  • ...$period (Period) – The period(s)

Returns:

A new instance of Timeline with the period(s)

Return type:

Timeline

withSection(Section ...$section)

Set section(s)

Parameters:
  • ...$section (Section) – The section(s)

Returns:

A new instance of Timeline with the section(s)

Return type:

Timeline

withTitle(string $title)

Set the timeline title

Parameters:
  • $title (string) – The title

Returns:

A new instance of Timeline with the title

Return type:

Timeline