How To Create A Yii Application Object

I want to use Yii functions in another open source projects (moodle, joomlma, …) So I can benefit Yii powerful models.

I put following code in one of the files (ROOT/course/edit.php):


$yii = dirname(__FILE__) . '/../mws/framework/yii.php';

$config = dirname(__FILE__) . '/../mws/protected/config/main.php';

defined('YII_DEBUG') or define('YII_DEBUG', TRUE);

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);

require_once($yii);

Yii::createWebApplication($config);

But I get following error:

[size="3"]How I can Create A raw Yii Application Object?[/size]

Hi,

Have you tried this

http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app

Unfortunately, this page didn’t help me.

I’m familiar about yii developement. I want to catch a yii::app() object in another application.

Hi wwwwww ! Try to include Yii core file yii.php to the your another project in this way:


require_once('path/to/yii.php');

And defined YII_PATH constant to your own scripts path.

P.S.

  • try read this:

extension.integration 2.