Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 520 Bytes

Formatter.md

File metadata and controls

23 lines (15 loc) · 520 Bytes

Formatter component

This component is designed to help format the common values in Contao.

Usage

See the examples below:

use Codefog\HasteBundle\Formatter;

// Format date/time/datim
$this->formatter->date($timestamp);
$this->formatter->time($timestamp);
$this->formatter->datim($timestamp);

// Display the tl_news.headline label
$this->formatter->dcaLabel('tl_news', 'headline');

// Display the tl_news.source formatted value
$this->formatter->dcaValue('tl_news', 'source', $newsModel->source);