PhalconPHP: Volt — generate url for named route with params

This is a quick example of how to generate url from a named route that requires params in Volt templating engine.

Your route declaration:

$router->add(‘/register/complete/{guid}’,
 [
 ‘controller’ => ‘auth’,
 ‘action’ => ‘complete’,
 ]
 )->setName(‘register-complete’);

Template tag to display the url (this assumes that the template is receiving a key ‘giud’ in the $params:

{{ url.get([‘for’: ‘register-complete’, ‘guid’: guid]) }}
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.