amteich / kirby-twig

Twig templating support for Kirby CMS
MIT License
48 stars 12 forks source link

Custom namespaces not working #11

Closed FNGR2911 closed 4 years ago

FNGR2911 commented 4 years ago

I'm trying to change and use the path to assets. My /site/config/config.php is looking like:

<?php

return [
    ...
    'timezone' => 'Europe/Berlin',
    'mgfagency.twig.namespace.assets' => __DIR__ . '../../assets',
];

Now I try to use it in my template file like:

{{ source('@assets/images/logo.svg') }}

But I'll get the following error:

There are no registered paths for namespace "assets".

Am I missing something?

Thank you!

FNGR2911 commented 4 years ago

Ok, it seems like it's working when I not try to use assets as the namespace. Tried it with images and now it's working.. Sorry, I'll close this issue.