<?php /** * Sample function class for Yii 1.x * * Usage: * – File: protected/controllers/functions/Orders/Test.php * – Call: $this->runFunction(‘test’, [$model]); */ class Test { public $controller; // auto assigned by runFunction() /** * Executes custom logic * @param mixed $model */ public function run($model) { echo “This is a test function running with model: […]
Category: Coding Standards
Sample Code For Action
<?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 ” . […]
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 […]
✅ Validate Value Against 0, Empty String, Undefined, and Null
✅ Validate Value Against 0, Empty String, Undefined, and Null 🔍 Purpose:Ensure that any value being checked is also Validated for 0 (zero), Empty String, Undefined, and Null to avoid unintended behavior or logical errors. 🔒 Standard Practice When validating a value to ensure it is not zero or invalid: ✅ Always validate against: […]