How to retrieve siteid in custom controller?
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!
How to retrieve siteid in custom controller?
Hello! The question may sound silly, but how can i retrieve parameters like Aimeos "siteid" and "site" in controllers, which are not related to Aimeos?
For example i provide one of my cases - in my Laravel app there is a PostController. Some methods of this controller are used in admin panel to create/edit/delete posts. Other methods i use in frontend.
In admin panel, after creation of the new post i would like to redirect the user to the list of all posts list in admin panel.
Usually, to get this done, in my controllers i use something like this:
But now i need to have redirect like this:
How can i retrieve "siteid" and "site" in my controllers, which are not related to Aimeos?
Thank you!
For example i provide one of my cases - in my Laravel app there is a PostController. Some methods of this controller are used in admin panel to create/edit/delete posts. Other methods i use in frontend.
In admin panel, after creation of the new post i would like to redirect the user to the list of all posts list in admin panel.
Usually, to get this done, in my controllers i use something like this:
Code: Select all
public function store(Request $request)
{
...
Post::create($request->all());
return redirect('/path/that/i/need')->with('success', 'Post created!');
}
Code: Select all
return redirect('/admin/{site}/jqadm/search/posts')->with('success', 'Post created!');
Thank you!
Re: How to retrieve siteid in custom controller?
I`m sorry, i forgot to provide my system info.
My Laravel version is 5.7.24, Aimeos version is 2019.01.1
System is Linux Fedora 29, PHP 7.2.13, Mariadb 10.2.19, Nginx.
My Laravel version is 5.7.24, Aimeos version is 2019.01.1
System is Linux Fedora 29, PHP 7.2.13, Mariadb 10.2.19, Nginx.
Re: How to retrieve siteid in custom controller?
The site code must be already part of the URL (e.g. /admin/{site}/jqadm/save/posts), then you can get it with
Code: Select all
$this->getView()->param( 'site' )
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star