Create href to presenter with array
- cameroncz
- Member | 1
Hey there,
I have a little problem, Im trying to create href from latte to presenter with
array as argument, but nette says only scalars are available. Till now i was
using
<a n:href="changeMain! market" .......> , but now i need
send array instead of “market”, is there a way to go?

- Casper
- Member | 253
If you want to pass multiple arguments stored in array, use
(expand) $args. See
documentation.
{var $args = [$productId, lang => cs]}
<a n:href="Product:show (expand) $args">product detail</a>
Last edited by Casper (30. 12. 2014 16:09)
- jiri.pudil
- Nette Blogger | 1035
If you want to allow arrays, you have to provide a typehint for the parameter in the target method, e.g.:
public function handleChangeMain(array $market)
{
}
RSS feed
Topic closed