Yii Framework Forum: Using Yii inside assets dir - Yii Framework Forum

Jump to content

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

Using Yii inside assets dir Rate Topic: -----

#1 User is offline   drylko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 13-September 09
  • Location:Poland

Posted 12 December 2009 - 05:51 PM

Is there a way to make sure that Yii app starts before any asset is loaded?
I would like to use Yii inside my image/file browser extension, but cant because of assets loading before Yii.
Now I get a Fatal error: Class 'Yii' not found in ...

I actually only need to set a few vars in my extension config files, and I can send those vars in session, but using framework functionality there would be much better idea and really handy

pd
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 13 December 2009 - 07:52 AM

Which files would that be? Usually asset files are only referenced from HTML pages that where generated with Yii. So they are always present at the time the browser fetches the assets.

Can you give a little more detail what you try to do?
0

#3 User is offline   drylko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 13-September 09
  • Location:Poland

Posted 13 December 2009 - 09:43 AM

View PostMike, on 13 December 2009 - 07:52 AM, said:

Can you give a little more detail what you try to do?

Im trying to dynamically setup my image/file browser for tinymce which have separate config file in assets directory and in this config file im trying to use Yii base class with no success...
Actually this a popup window with url referencing to some file eg. conn.php in my assets dir which includes my config file, and i think that's the problem, because it's not Yii calling my conn.php :)
0

#4 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 14 December 2009 - 04:44 AM

You can include yii.php in that file and also call Yii::createWebApplication($config); if you e.g. need access to ActiveRecords.
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