How To Get Action Name In Cconsolecommand?

How to get action name ‘Show’ in CConsoleCommand?If I need to get the action name from FUNCTION or init a public varible in beforeAction()?




<?php


class TestCommand extends CConsoleCommand{

    public $action;

    

    protected function beforeAction($action, $params) {

	$this->action = $action;

	return parent::beforeAction($action, $params);

    }

    

    public function actionShow(){

	var_dump($this->action,___FUNCTION__);

    }

}



just trim the word action


var_dump(ltrim(__FUNCTION__, "action"));