Overriding base helper functions
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!
-
- Posts: 2
- Joined: 27 Mar 2023, 06:10
Overriding base helper functions
Is there any way to override default helper function of
$view->link() so I want to add some parameter in all urls.
https://github.com/aimeos/aimeos-base/b ... andard.php
https://github.com/aimeos/aimeos-base/b ... andard.php
Thanks in advance.
$view->link() so I want to add some parameter in all urls.
https://github.com/aimeos/aimeos-base/b ... andard.php
https://github.com/aimeos/aimeos-base/b ... andard.php
Thanks in advance.
Re: Overriding base helper functions
Not directly. First, you have to create your own version of the Link and URL view helper. Then, create your own view object implementation:
https://github.com/aimeos/aimeos-larave ... e/View.php
The last step is to register your new view object in the ServiceProvider of your Laravel package:
https://github.com/aimeos/aimeos-larave ... #L104-L106
I'm not totally sure how Laravel handles registration of objects using the same name, esp. what the order of execution will be. Please ask at a Laravel forum first how this is handled.
https://github.com/aimeos/aimeos-larave ... e/View.php
The last step is to register your new view object in the ServiceProvider of your Laravel package:
https://github.com/aimeos/aimeos-larave ... #L104-L106
I'm not totally sure how Laravel handles registration of objects using the same name, esp. what the order of execution will be. Please ask at a Laravel forum first how this is handled.
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