Yii Command Line Does Not Autoload Models

柔情痞子 提交于 2019-12-05 16:03:25

The yiic command uses usually a different config file than your web application.

Define the needed paths in the import section of your config/console.php, like you have it in your config/main.php.

Write this code in your config/console.php
// autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
    ),

for more detail http://www.yiiframework.com/doc/guide/1.1/en/topics.console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!