<?php /** * Sample custom action for Yii 1.x * * Usage: * – Create file: protected/controllers/actions/Orders/TestAction.php * – Access via URL: index.php?r=orders/test */ class TestAction extends CAction { /** * This method is executed when the action is called. */ public function run() { echo “This is a test action running from ” . […]
Monthly Archives: September 2025
Standard Code FOR Controller
<?php class TestController extends CController { /** * @var string the default layout for the views. Defaults to ‘column2’, meaning * using two-column layout. See ‘protected/views/layouts/column2.php’. */ //public $layout = ‘application.views.layouts.main’; /** * @var CActiveRecord the currently loaded data model instance. […]
Controller Refactoring Documentation
1. Overview Previously, controllers (e.g., OrdersController) contained hundreds of actions and functions in a single file. This made the codebase difficult to read, maintain, and scale. To improve structure, we have refactored the controller format. Now, each controller: Contains only core/major logic. Delegates Actions and Functions to separate files inside their respective folders. 2. New […]