Skip to content

Configuration

Let’s configure PageBlocks to work exclusively with controllers, in development mode, and with the Fenom templating engine. This way, you’ll be working only with file-based elements — no database clutter.

Set system settings:

  • pageblocks_development_modeDeveloper (enables development mode)
  • pageblocks_routingFull API (full control over routing)
  • pageblocks_parserpbFenom (use the Fenom template engine)

Server configuration:

  • For Apache: rename ht.access to .htaccess
  • For Nginx: make sure to configure the appropriate rewrite rules

Built-in route for standard pages

PageBlocks includes a built-in route to handle regular MODX resources:

php
Route::get('/{alias?}', [ResourceController::class, 'index']);

This default route allows you to open any MODX-style page by its alias (friendly URL). It is handled by the internal ResourceController, which:

  • automatically finds the matching MODX resource,
  • loads the appropriate Fenom template,
  • and renders the base HTML page (templates/base).

You can override this route at any time to change how pages are handled or to load a different default layout.

By default, PageBlocks already routes standard pages for you — so you're ready to go without any extra setup.

© PageBlocks 2019-present