The methods that Bromine provides for the API to be used on the front-end of the site in public controllers.
Return, modify and save blocks – bits of pages that can be edited by users. It might be part of the footer or a message on the contact page. Blocks are written in Markdown and rendered and cached on request.
Returns a block as a string. The $block variable is the URI of the block.
<?php echo Bromine\Block::get('contact-thanks'); ?>
Prepends the site’s name and anything added.
Returns the the title as a string.
<head>
<title><?php echo Bromine\Title::get(); ?></title>
</head>
Appends the string to the end of the title, using : as a separator.
$title = $article->title;
Bromine\Title::append($title, ' · ');
Overwrites the existing title, but includes the site title unless $title_overwrite is set to true.
$title = $article->title;
Bromine\Title::set($title);
// Site Name: The leaves are falling
$title = 'Article: '.$article->title;
Bromine\Title::set($title, true);
// Article: The leaves are falling
Returns a View object of the model or an array of the menu. The menu is stored in a table.
Returns a View object of the view, found in views/menu.php. Optionally ask for only the children of a parent. Second parameter is the ID of the active page, which will set the <li> to <li class="active"> for that entity.
$this-template->menu = Bromine\Menu::view();
// Or with an active page ‘active’
$this-template->menu = Bromine\Menu::view($page->parent, $page->id);
Returns a multidimensional array of the menu. Optionally ask for only the children of a parent.
$this->template->menu = Bromine\Menu::get();