title: Error include in Yiiibase.php - Yii Framework
body: <p>I have a project Yii. I call model from my controller to display data in a table</p>
  
  <pre><code>$model = new NewAccForm();
  $post = Post::model()-&gt;find($model);
  var_dump($post);
  </code></pre>
  
  <p>I run the code on an error:</p>
  
  <blockquote>
  <pre><code> PHP warning
  
  include(Post.php) [&lt;a href='function.include'&gt;function.include&lt;/a&gt;]: failed to open stream:
  </code></pre>
    
    <p>No such file or directory</p>
  
  <pre><code>E:\wamp\www\yii\framework\YiiBase.php(427)
  
  415                         {
  416                             include($classFile);
  417                             if(YII_DEBUG &amp;&amp; basename(realpath($classFile))!==$className.'.php')
  418                                 throw new CException(Yii::t('yii','Class name "{class}" does not match class
  </code></pre>
    
    <p>file "{file}".', array(
        419                                     '{class}'=>$className,</p>
  
  <pre><code>420                                     '{file}'=&gt;$classFile,
  
  421                                 )));
  
  422                             break;
  
  423                         }
  
  424                     }
  
  425                 }
  
  426                 else
  
  427                     include($className.'.php');
  
  428             }
  
  429             else  // class name with namespace in PHP 5.3
  
  430             {
  431                 $namespace=str_replace('\\','.',ltrim($className,'\\'));
  
  432                 if(($path=self::getPathOfAlias($namespace))!==false)
  
  433                     include($path.'.php');
  
  434                 else
  
  435                     return false;
  
  436             }
  437             return class_exists($className,false) || 
  </code></pre>
    
    <p>interface_exists($className,false);</p>
  
  <pre><code>438         }
  
  439         return true;
  
  Stack Trace
  #0    
  +  E:\wamp\www\yii\framework\YiiBase.php(427): YiiBase::autoload()
  #1    
   unknown(0): YiiBase::autoload("Post")
  #2    
  –  E:\wamp\www\yii\amica\protected\controllers\front\ReportController.php(10):
  </code></pre>
    
    <p>spl_autoload_call("Post")
        05         '1'=>'Mới',
        06         '2' => 'Đã Xóa'
        07     );
        08     public function actionIndex() {
        09         $model = new ReportForm();
        10         $post = Post::model()->find($model);
        11         var_dump($post);
        12         echo "<h1>Thông báo lỗi cho ban quản trị</h1>";
        13     }
        14 
        15     public function actionCreate() {
        #3<br>
        +  E:\wamp\www\yii\framework\web\actions\CInlineAction.php(49): ReportController->actionIndex()
        #4<br>
        +  E:\wamp\www\yii\framework\web\CController.php(308): CInlineAction->runWithParams(array("r" => "report"))
        #5<br>
        +  E:\wamp\www\yii\framework\web\CController.php(286): CController->runAction(CInlineAction)
        #6<br>
        +  E:\wamp\www\yii\framework\web\CController.php(265): CController->runActionWithFilters(CInlineAction, array())
        #7<br>
        +  E:\wamp\www\yii\framework\web\CWebApplication.php(282): CController->run("")
        #8<br>
        +  E:\wamp\www\yii\framework\web\CWebApplication.php(141): CWebApplication->runController("report")
        #9<br>
        +  E:\wamp\www\yii\framework\base\CApplication.php(180): CWebApplication->processRequest()
        #10<br>
        –  E:\wamp\www\yii\amica\protected\components\WebApplicationEndBehavior.php(24):
    CApplication->run()
        19         // Attach the changeModulePaths event handler
        20         // and raise it.
        21         $this->onModuleCreate = array($this, 'changeModulePaths');
        22         $this->onModuleCreate(new CEvent($this->owner));
        23 
        24         $this->owner->run(); // Run application.
        25     }
        26 
        27     // This event should be raised when CWebApplication
        28     // or CWebModule instances are being initialized.
        29     public function onModuleCreate($event) {
        #11<br>
         unknown(0): WebApplicationEndBehavior->runEnd("front")
        #12<br>
        +  E:\wamp\www\yii\framework\base\CComponent.php(261): call_user_func_array(array(WebApplicationEndBehavior, "runEnd"),
    array("front"))
        #13<br>
        –  E:\wamp\www\yii\amica\index.php(13): CComponent->__call("runEnd", array("front"))
        08 defined('YII_DEBUG') or define('YII_DEBUG',true);
        09 // specify how many levels of call stack should be shown in each log message
        10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
        11 
        12 require_once($yii);
        13 Yii::createWebApplication($config)->runEnd('front');
        #14<br>
        +  E:\wamp\www\yii\amica\index.php(13): CWebApplication->runEnd("front")</p>
  </blockquote>
  
  <p>why is there such a problem? and how to fix it? Thanks.</p>