When I open web views, for example …/webs/view/1, it will show the related audits. In the related audit (view in webs), it has user_id and session_id, which show the number, e.g., user_id == 1 and session_id == 1. The user table has a fullname column, and the session table has a name column. How can I render the fullname and session name in the related record view on the web view?
Thank you, and I appreciate any assistance from the forum members.
$web->sessions contains all the associated Sessions records which are mapped to your current web entry. This automatically happens if you do $this->Webs->get($id, ['contain' => ['Sessions']]) inside your controller action - its called Eager Loading
$session inside the foreach is just an entity of type App\Model\Entity\Session and therefore represents the associated record in your current web entry.