Passing multiple variables to view
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Passing multiple variables to view
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:
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:
Even this basic function to pass a variable to the view is failing:
Who can help me out on this one? Much appreciated!
Regards,
Kevin
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);
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);
Code: Select all
return View::make('shop::account.subscriptions', compact('params'));
Regards,
Kevin
Re: Passing multiple variables to view
What about simply using
or
Code: Select all
$params['myparam'] = '...';
Code: Select all
$params = array_merge( $params, $otherarray );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
