{"version":"1.0","type":"rich","title":"sample action","description":"This example shows a PHP controller action that handles event registration by creating a new Registration model instance, saving user-submitted form data, and then decrementing the corresponding event’s available seat count. It first checks for a POST request, assigns the submitted attributes to the model, and saves it. If successful, it retrieves the related Event record via `Event::model()->findByPk()`, subtracts the number of seats requested, and updates the event before redirecting. The code relies on Yii’s ActiveRecord pattern, using the `Registration` and `Event` models, without any client-side visualization or charting libraries.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-03d35840e0e0cf8c149c?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}