Overriding base helper functions

Help for integrating the Laravel package
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!
santoshgarudi
Posts: 2
Joined: 27 Mar 2023, 06:10

Overriding base helper functions

Post by santoshgarudi » 12 Apr 2023, 17:45

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.

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: Overriding base helper functions

Post by aimeos » 17 Apr 2023, 08:32

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply