Tools For Better Developers

Osm Framework

Learn how Osm Framework works, how to use and extend it. We publish the information here first, and some of it is eventually added to the official Osm Framework documentation. For even more details, check its source on GitHub.

Framework: View Prototypes And Render-Time Views

2022 March Osm Framework

2 years ago ∙ 1 minute read

A View is a short-living object that is created and computed during page rendering. You can also create a pre-configured a View object prototype in advance, and then clone it for rendering.

It's important not to execute render-time properties while configuring the prototype.

Use view() helper function to create render-time view instances, and mark render-time properties using #[RenderTime] attribute to prevent accessing them before rendering.