Paint the Web - a micro-Blog in .md about Dev, Web and more

Hydro Templating

Flood\Hydro uses Twig as main template language. Most templates are build with Canal\View.

See Canal Templating and Canal Template Fragments for the main documenation on the base template and a lot of automatic logic within those.

How to install Canal. How to install Hydro.

Pre-installed in Hydro, the Canal\View files could also be installed with:

composer require flood/canal-view

Configuration

HookFile

In config/theme.json is the base configuration defined.

{
  // bool : if the theme handler should display exceptions
  "debug": true,
  // hash : contains view folder
  "path-view": {
    // index is path, value is namespace
    "hook/demo/view": "demo"
  },
  // twig environment configuration, will be added as is, see https://twig.symfony.com/doc/2.x/api.html#environment-options
  "env-config": {
    "cache": "tpl",
    "debug": true,
    "auto_reload": true
  }
}

For each hook it is possible to add additional configuration.

After the index theme belongs the used configuration:

{

  "<hook-id>": {
    "theme": {
      "path-view": {
        "<some/path>": "<namespace>",
        "vendor/flood/canal-view/src": "canal"
      }
    }
  }
}
  • path-view defines the folders in which the template files are, all namespace folders are with automatic-overwrite

Additional Values

  • i18n
    • get
  • content
    • get