This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Tiipiik
Tiipiik

Hi,

Is there a way to access properties of a component from another one ? I am developing a plugins with multiple components and I need to get the url model property. For example if in the first component the user can define the url type like this => categorie/:id, and in the second component i need to get this :id property, how do I do that ? Thanks.

Tiipiik
Tiipiik

Nobody ? Maybe I'm not clear with what I want to do ? Ask me if you want more precisions. Waiting for this I will change how this works in my plguin, but I'm really interesting in a solution, I think it could be usefull for futur plugins ;)

Shahiem
Shahiem

Hi,

Maybe this will work.

use Author\PluginNamespace\Components\Classname

$className = new Classname;
return $className->property('propertName');

Last updated

Tiipiik
Tiipiik

Oh yeah that's it ! So simple I think I should go to hide ^^' Just replace the two points and I got the dynamic value, thank you Shahiem !

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.