php - Yii, importing library does not work -
i'm trying implement identicon library site error class not found.
i tried yii::import('application.vendor.*'); put library in vendor folder, not work.
i tried adding library component controller still gives me error.
and tried making import in view code be
<?php yii::import('application.vendor.*'); $identicon = new identicon; $identicon->displayimage('test'); ?> and yet tells me error class not found. copied src folder zip vendors , components. how can import library?
if folder structure like
-- root -- protected |---- vendors |---- myfolder |---- myclass.php you can import this
yii::import('appplication.vendors.myfolder.myclass'); since yiis auto load based on file name, if class identicon defined in myclass wont loaded because has different file name, in case have go with:
yii::import('appplication.vendors.myfolder.*' , true);
Comments
Post a Comment