Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Problem with Volt functions

Hello guys, Im trying to run the following code:

{{ url('user/' ~ base64encode(post.User.userid)) }}

But when Volt compiles a semicolon appears miss placed

<?= $this->url->get('user/' . VoltLib::base64encode($post->User->userid);) ?>

Volt cant handle with that?

I guess this should return without semicolon

<?= $this->url->get('user/' . VoltLib::base64encode($post->User->userid)) ?>

How can i bypass that? thank you


Sometimes I get this behaviour also, but sadly I don't remember what was the cause of it. I will write it down next time and share with everyone :)

Try setting post.User.userid to a variable and then pass it to the function.

{% set someVar = post.User.userid %}