Yii Framework Forum: Yii::import() not working in "Using Yii 2 with Yii 1" - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii::import() not working in "Using Yii 2 with Yii 1" Rate Topic: -----

#1 User is offline   Shy Evsa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 03-September 10

Posted 24 August 2017 - 04:48 AM

So I follow the guide here:
http://www.yiiframew...-both-yii2-yii1

for somereason all Yii::import() inside class are not working.
for example I have a widget that extend CPortlet like this

Yii::import('zii.widgets.CPortlet');

class sideWidget extends CPortlet{
}


it will generate error "include(CPortlet.php): failed to open stream: No such file or directory"
I was able to workaround it by included zii.widget.* inside config/main.php import

but then some class like CJavaScript::quote will generate another error because it use
Yii::import('system.vendors.zend-escaper.Escaper');

this is also resolvable by putting 'system.vendors.zend-escaper.*' in the config/main.php import

but then it would require me to put all the import be it inside the framework or my own project into config.

Did I miss something here?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users