How to add own action to admin ?
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!
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
How to add own action to admin ?
My environment is the following:
Laravel Framework 5.8.26
aimeos-laravel 2019.04
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1
As I see \Aimeos\Shop\Controller\JqadmController has several actions like 'get', 'search' and other. I need implement my own action 'download'. And this action must send file to browser. In my \Aimeos\Admin\JQAdm\Documents\Standard class I try to do it under export action:
But it doesn't work, file is not downloaded. Browser just show me html code. I think it is because each action of \Aimeos\Shop\Controller\JqadmController does the following:
How can I avoid it ?
Laravel Framework 5.8.26
aimeos-laravel 2019.04
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1
As I see \Aimeos\Shop\Controller\JqadmController has several actions like 'get', 'search' and other. I need implement my own action 'download'. And this action must send file to browser. In my \Aimeos\Admin\JQAdm\Documents\Standard class I try to do it under export action:
Code: Select all
return response()->download($file);
Code: Select all
return $this->getHtml( $html );
Re: How to add own action to admin ?
You should create your own action that handles the output for downloads correctly, Then, you can configure the named route you've defined for your action in the Aimeos config: https://github.com/aimeos/aimeos-larave ... lt.php#L70
In your JQAdm class, you need to use
to retrieve the named route and pass it to the "$this->url()" method to generate the required URL.
We would love to get your changes into Aimeos. Can you create a pull request on GitHub for your changes?
In your JQAdm class, you need to use
Code: Select all
$this->config( 'admin/jqadm/url/download/target' )
We would love to get your changes into Aimeos. Can you create a pull request on GitHub for your changes?
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