Yii - How to access to model and call action in yiic

人走茶凉 提交于 2019-12-01 23:32:39

First you have to create a command: http://www.yiiframework.com/doc/guide/1.1/en/topics.console#creating-commands

Then you can acess your function by running this command: yiic yourCommand start

You have to load your models in Console application.

Open console.php configuration file, and add this line under the line 'name'=>'My Console Application',

'import'=>array(
        'application.models.*'
    ),

It should work.

It seems that your don't have such 'log.php' file you are including.

maybe try this from console :

touch /path/to/app/folder/protected/log.php

You should have another error message then (or it will run smoothly).

Just open your yiic.php file check framework path in it.

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