Google News
logo
Yii framework - Interview Questions
What is the naming convention in Yii Framework?
In the latest version of Yii Framework uses a simple standard to set names.
 
* You can define the table prefix when using Gii. In your case, you need to set it to tbl_. Then it should generate UserController instead of TblUserController.

* The Yii Framework employs a class naming convention whereby the names of the classes directly map to the directories in which they are stored. The root-level directory of the Yii Framework is the "framework/" directory, under which all classes are stored hierarchically.

* Class names may only contain alphanumeric characters. Numbers are permitted in class names but are discouraged. A dot (.) is only permitted in place of the path separator.

Routes that refer respectively to module, controller, and the action requested take the following format:
 
ModuleID/ControllerID/ActionID
 
* The ModuleID is optional. The ModuleID must be specified in the module's configuration property under the same name.

* The ControllerID and ActionID should contain only English characters in lowercase, digits, underscores, dashes, and forward slashes.

* URL Conventions: By default, Yii recognizes URLs with the following format :
http://hostname/index.php?r=ControllerID/ActionID ​

The r refers to the route.

Advertisement