<?php /** * @author Roman Ozana <*****@*****.**> */ namespace cms { /** @var \cms\Sphido $cms */ // Follow files are used in examples require_once __DIR__ . '/../vendor/sphido/json/src/json.php'; require_once __DIR__ . '/../vendor/sphido/http/src/http.php'; require_once __DIR__ . '/../vendor/sphido/download/src/download.php'; // get pages for menu $cms->pages = Pages::from(\dir\content(), ['404', \dir\content('example')])->toArraySorted(); // Custom default error handler... if 404.md missing in root on('render.default.error', function () { echo 'Page not found...'; }); } namespace { /** @var \cms\Sphido $cms */ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! return; // follow examples are disabled by default // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /** * Write {yolo()} for calling function from markdown or Latte template */ function yolo() { require_once __DIR__ . '/../vendor/sphido/http/src/http.php'; \http\redirect('http://www.omdesign.cz');
function menu() { return Pages::from(\dir\content(), ['404', \dir\content('example')])->toArraySorted(); }
<?php namespace cms; /** @var \cms\Sphido $this */ // add Follow line to public/functions.php $this->pages = Pages::from(\dir\content('/example'))->toArraySorted();