Yii Extension Component Authoring Method Example analysis, Yii extension component _php Tutorial

Source: Internet
Author: User

Yii extension Component Authoring Method instance analysis, Yii extension component


This paper describes how to write yii extension components. Share to everyone for your reference. Specific as follows:

Because Yii itself introduced Prado's component-based thought as the main idea. As a result, components are important in yii.

Components are typically placed in the component directory, with an example of the following basic format:

 Components */class Utilities extends ccontroller{public  static function Testtool ($param)  {   // Codes  }}

Examples of using method formats:

<?phpecho Utilities::testtool ($param);? >

The reason for implementation is also simple, because all extensions inherit the base class of the system, so when using the method in the application, Yii imports the method to register the class.

It is hoped that this article is helpful to the PHP program design based on YII framework.

http://www.bkjia.com/PHPjc/1024129.html www.bkjia.com true http://www.bkjia.com/PHPjc/1024129.html techarticle Yii extension Component Writing method instance analysis, Yii extension Component This article describes the Yii extension component writing method. Share to everyone for your reference. This is as follows: Because Yii itself introduces ...

  • Related Article

    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.