A method _php example of automatic loading class map for Yii

Source: Internet
Author: User
In this paper, the method of implementing the automatic loading class map of Yii is described. Share to everyone for your reference. Specific as follows:

Yii inherits a static property $classmap, which can be used for Yii's automatic load class map. The keys in the array are the class names, and the values in the array are the paths to the corresponding class files.

Require_once ($yii); $app = Yii::createwebapplication ($config); Yii:: $classMap = Array (  ' jphpmailer ' = = Yii::getpathofalias (' ext ').   ' /phpmailer/jphpmailer.php ',); $app->run ();//You can no longer use Yii::import () to introduce files. $mailer = new Jphpmailer ();

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

  • 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.