Set page property in controller


Is it possible to set/override a property in a controller?


yes, you can retrieve properties and also set new values:

$this->document->setProperty('propertyName', 'text', 'new value')->save();


OK - that works.

When calling an action by a static route, how to set properties in this case? If I set them like shown the way above, the properties are set in the root document (1). That’s not what I want to do. I want to set the properties “temporary” for an action call by static route.



You can load any document by



So I have to create a kind of “dummy” document to use with the controller action?


You are approaching the wrong use-case for properties hear. If you wanna pass options to a sub-action you can do so by using symfony sub-requests.