Set the necessary parameter values in my own action

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!
User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Set the necessary parameter values in my own action

Post by ahmed31916 » 23 Apr 2022, 08:36

Hello,

What if I tried to set the necessary parameter values in my own action like this:

Code: Select all

$this->object()->data( $this->view(), $this->tags, $this->expire );
what is

Code: Select all

$this->object()
refers to?

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

Re: Set the necessary parameter values in my own action

Post by aimeos » 23 Apr 2022, 19:49

If you add a decorator to an object which wraps the object, you get an onion-like structure, e.g.:

Code: Select all

SomeDecorator (
    MyDecorator (
        Myclass
    )
)
The "$this->object()" returns the inner object (if called from MyDecorator, it will return MyClass) and you pass the parameters you got in your method down to the next object.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: Set the necessary parameter values in my own action

Post by ahmed31916 » 24 Apr 2022, 07:34

How can I do if "myclass" is a blade file "myclass.blade.php"?
in another words, how to set these parameters in "myclass.blade.php" by the action?

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

Re: Set the necessary parameter values in my own action

Post by aimeos » 25 Apr 2022, 10:56

Assign your variable in the addData() method to the view object (which is an adapter to the blade view):
https://aimeos.org/docs/latest/frontend ... s/#example
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply