method redirect does not accept parameter as an array, in recent version working

thcom
Backer | 94
+
0
-

hi please help me with this issue

<?php
	$pars = array($par_kt, $par_pd, $par_kr, $par_ob, $par_tm, $par_kv, $par_st, $params);
	$this->redirect('show', $pars);
?>

i get this error :/

Argument $par_kt passed to App\Presenters\HomepagePresenter::renderShow() must be scalar, array given.

with older nette version it was working

thank you for help !

Last edited by thcom (2019-12-11 10:08)

CZechBoY
Member | 3608
+
0
-

Can you send HomepagePresenter::renderShow function signature?

thcom
Backer | 94
+
0
-
<?php
	public function renderShow($par_kt, $par_pd, $par_kr, $par_ob, $par_tm, $par_kv, $par_st, $params) {
?>
David Grudl
Nette Core | 8082
+
0
-

When you expect arrays, add typehint:

public function renderShow(array $par_kt, ...)
thcom
Backer | 94
+
0
-

David Grudl wrote:

When you expect arrays, add typehint:

public function renderShow(array $par_kt, ...)

thank you BIG BOSS ! :)