This article mainly introduces how Yii can automatically load map types. It involves Yii loading skills and has some reference value. For more information, see
This article mainly introduces how Yii can automatically load map types. It involves Yii loading skills and has some reference value. For more information, see
This article describes how Yii automatically loads class maps. Share it with you for your reference. The details are as follows:
Yii inherits a static attribute $ classMap, which can be used to automatically load the class map of Yii. The key in the array is the class name, and the value in the array is the path of the corresponding class file.
Require_once ($ yii); $ app = Yii: createWebApplication ($ config); Yii: $ classMap = array ('jphpmailer' => Yii :: getPathOfAlias ('ext '). '/phpmailer/JPhpMailer. php ',); $ app-> run (); // you do not need to use Yii: import () to introduce files. $ Mailer = new JPhpMailer ();
I hope this article will help you design php programs based on the Yii framework.
,