Yii extension component Writing Method Instance Analysis

Source: Internet
Author: User
This article describes how to compile the Yii extension component. The example analyzes the implementation skills of the extension component in the Yii framework. For more information, see

This article describes how to compile the Yii extension component. The example analyzes the implementation skills of the extension component in the Yii framework. For more information, see

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 components */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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.