Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

How To Call Controller/action In Console Command

$
0
0
I had create an action in controller and wish to reuse it by calling it in console command. my action in controller work fine in web but can't call in command console. Please help.

class MyExampleController extends Controller
{
...
public function actionShowMe()
{
echo "testing";
}
...


}
-------------------------------------------------------------------------------------------
class GoCommand extends CConsoleCommand
{
public function run($args)
{
echo $this->renderInternal('myExample/showMe');
}
}

Viewing all articles
Browse latest Browse all 18717


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>