Creating a View Page
View pages display records in read-only mode. Generate one when creating a resource:getPages():
The View Page Class
packages/panels/src/Resources/Pages/ViewRecord.php
Display Options
- Disabled Form (Default)
- Infolist
By default, View pages show a disabled version of the Edit form:The form is automatically disabled:
packages/panels/src/Resources/Pages/ViewRecord.php
Infolist Components
Infolist entries are optimized for displaying data:Customizing Data Before Fill
When using a disabled form (not an infolist), you can modify data before it’s displayed:Lifecycle Hooks
Available hooks when using a disabled form:packages/panels/src/Resources/Pages/ViewRecord.php
Header Actions
Add actions to the page header:Viewing in Modals
For simple resources, view records in modals instead of dedicated pages:- Delete the View page file
- Remove it from
getPages() - Add a
ViewActionto your table:
Multiple View Pages
Create separate View pages for different aspects of a record:Customizing Relation Managers
Show different relation managers on different View pages:Adding to Sub-Navigation
When using resource sub-navigation, register View pages:Page Content
The default View page schema:packages/panels/src/Resources/Pages/ViewRecord.php
Authorization
Users can access the View page if theview() method of the model policy returns true: