Page::getStyle()

Version 4

Name of the color style

Return color according to table preferences.

All Colors.

See also CSS styles.

Return value

String

Full documentation

Show title and description of all orders that are to be delivered this week. Set background color with page color definition:

foreach ( $this->get('pages','order')->addWhere('delivery_date','This week') as $Order ){
    $txt .= "
        <DIV class='u-bg--{$Order->getStyle()}'>
          <h2>{$Order->getTitle()}</h2>
          <p>{$Order->getDescription()}</p>
        </DIV>";
}