Class not found

components/Test.php :

<? php

class Test extends CWidget


    public $title='Testing';

    public function run()





components/views/test.php :

<p> Hello World </p>


<?php $this->widget('Test'); ?>

main.php (config file) :

// autoloading model and component classes





(by the way : what path does "application" is, is it somewere configured ? )


render('test'); } }render('test'); } }

Fatal error: Class 'Test' not found in D:\wamp\www\yii\framework\web\CBaseController.php on line 138

I cannot find the error  ???

You have a space between <? and php in your Test.php?

Try to include this file explicitly in your controller class:

Yii::import('application.components.Test', true);

thankz…  :D (I was trying to find the fault for more than 1 hour)