Yii extension component Writing Method Instance analysis, yii extension component
This article describes how to compile the Yii extension component. Share it with you for your reference. The details are as follows:
Yii introduces the component-based idea of Prado as its main idea. Therefore, components are very important in yii.
Components are generally stored in the components directory. The format example is as follows:
<? Php/*** some description about the <span style = "color: rgb (34, 34, 34); font-family: Arial, sans-serif; font-size: 12.800000190734863px; line-height: 19px; "> components </span> */class Utilities extends CController {public static function testTool ($ param) {// codes }}
Sample format:
<? Phpecho Utilities: testTool ($ param);?>
The reason for implementation is also very simple. Because all extensions inherit the basic class of the system, yii imports and registers the method when this method is used in the application.
I hope this article will help you design php programs based on the Yii framework.