Skip to content

Static pages

John Bent edited this page Jul 18, 2020 · 1 revision

If you want to create a new static page for the website, i.e., a page that does not need to have access to the database, follow these steps:

  • Create a new file in /templates/Pages/ using the name of the page that will be accessed by URL. For instance, the URL /new-page will be /templates/Pages/new_page.php. Notice that the dash symbol in the URL is translated into an underscore in the file name.
  • Normally the new page will be accessible only at /pages/display/new-page. To ensure the /new-page URL works for the new page you need to create a routing rule in config/routes.php according to the example:
$builder->connect('/new-page', [
   'controller' => 'Pages',
   'action' => 'display',
   'new-page'
]);
Clone this wiki locally