Docs: Head, assets and views

Head, assets and views

Dates, the head and the files around a view: date, seo, assets, asset, providesContainer, option and render.

Formatting #

date($value, $style = 'date') #

A stored time (a Y-m-d H:i:s UTC string, or a Unix timestamp) in the site's time zone and the content language (E). Styles: date (10 October 2026), short (10 Oct 2026), datetime, time, month (October 2026) and iso for <time datetime>. There are no "3 days ago" styles, because a cached page would keep saying them.

<?= $this->date($post['published'], 'short') ?>

The head and the contracts #

seo(), icons(), design() #

The head block, the icon set and the design-token block (M). Each claims its contract; leave one out and core adds it for you.

<?= $this->seo() ?>
<?= $this->icons() ?>
<?= $this->design() ?>

assets($kind) #

The stylesheets ('css') or scripts ('js') that modules pushed for this page (P). Calling it claims the asset channel.

<?php foreach ($this->assets('css') as $url): ?><link rel="stylesheet" href="<?= htmlspecialchars($url, ENT_QUOTES, 'UTF-8') ?>"><?php endforeach; ?>

asset($path) and pushAsset($kind, $url) #

asset() gives a file in your theme's assets/ as a URL with a version stamp (P). pushAsset() is for modules, to add a stylesheet or script to the channel.

<link rel="stylesheet" href="<?= htmlspecialchars($this->asset('main.css'), ENT_QUOTES, 'UTF-8') ?>">

providesContainer() #

Claims that your <main is already width-limited, centred and guttered.

<?php $this->providesContainer(); ?>

option($key, $default = null) #

One of the theme's own options (P). A choice the theme does not declare gives the default.

<body class="layout-<?= htmlspecialchars($this->option('header_layout', 'split'), ENT_QUOTES, 'UTF-8') ?>">

Views #

render($view, $data = []) and component($name, $data = []) #

Include a view or a component of your theme, with core's version as the floor when you have none.

<?php $this->component('header'); ?>