Wednesday, March 9, 2022

[FIXED] Is there a way to call the __d function in Cakephp 3 in a twig template?

Issue

I have installed wyrihaximus/twig-view in a CakePHP app which works fine except I don't know how to call the function __d() or any of the other related translate functions.

How do I access them?

EDIT

Specifically when I call {{ __('Hello') }} or {{ __d('Domain', 'Hi') }} functions I get the unknown __ function or unknown __d function error.


Solution

In accordion with the doc here, in the Functions section:

__d maps to __d

So simply try something like this:

{{__d('my_plugin', 'Trending right now')}}

Hope this help



Answered By - Matteo

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.