Page 1 of 1

Passing multiple variables to view

Posted: 28 Nov 2017, 20:02
by Kevin
Hi all,

I'm struggling with my Laravel + CodeIgniter instance. I did update my routes so the myaccount function is handled through my own controller instead of the default AccountController that comes with Aimeos.

The code to within my function is the following and works perfect:

Code: Select all

$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'account-index' );
return Response::view('shop::account.index', $params);
Now I want to pass an extra parameter to the view, but the system keeps failing with everything I'm trying... I keep receiving the error that 'Aibody' in an undefined variable.

I did try every possible Laravel way to pass multiple parameters to the view:

Code: Select all

return view('shop::account.subscriptions', compact('params', 'otherarray'));

Code: Select all

$data = array(
		   'params'  => $params,
		   'testarray'   => $testarray,
		);
return View::make('shop::account.subscriptions')->with($data);
Even this basic function to pass a variable to the view is failing:

Code: Select all

return View::make('shop::account.subscriptions', compact('params'));
Who can help me out on this one? Much appreciated!

Regards,
Kevin

Re: Passing multiple variables to view

Posted: 28 Nov 2017, 22:29
by aimeos
What about simply using

Code: Select all

$params['myparam'] = '...';
or

Code: Select all

$params = array_merge( $params, $otherarray );

Re: Passing multiple variables to view

Posted: 30 Nov 2017, 14:37
by Kevin
Thanks!