Skip to main content
100%

Gist 3337600

✓ Published0🌍 Public
Aallyraza
Last edited Aug 13, 2012
Created on Aug 13, 2012

This example shows a PHP controller action for updating a guest reservation and its associated room information in a Yii-based application. The `actionUpdate` method loads both the reservation model and the room information model using `loadModel` and `loadRoomInformationModel`, then saves the posted attributes from `$_POST['GuestReservations']` and `$_POST['RoomInformation']` if both are submitted. On success, it redirects to the room view page; otherwise, it renders the partial again with validation errors. The code relies on Yii’s ActiveRecord `save()` method and `CHttpException` for error handling, with data sourced from form submissions.

AI-generated description

Similar vizzes