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

4 months ago

thcom
Member | 52
+
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)

4 months ago

CZechBoY
Member | 3494
+
0
-

Can you send HomepagePresenter::renderShow function signature?

4 months ago

thcom
Member | 52
+
0
-
<?php
	public function renderShow($par_kt, $par_pd, $par_kr, $par_ob, $par_tm, $par_kv, $par_st, $params) {
?>

4 months ago

David Grudl
Nette Core | 6985
+
0
-

When you expect arrays, add typehint:

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

4 months ago

thcom
Member | 52
+
0
-

David Grudl wrote:

When you expect arrays, add typehint:

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

thank you BIG BOSS ! :)