本文整理汇总了PHP中yii\console\Controller::afterAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::afterAction方法的具体用法?PHP Controller::afterAction怎么用?PHP Controller::afterAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\console\Controller
的用法示例。
在下文中一共展示了Controller::afterAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterAction
public function afterAction($action, $result)
{
$result = parent::afterAction($action, $result);
foreach ($this->_savedCommands as $targetClass => $args) {
if (array_key_exists($targetClass, $this->_commands)) {
$this->_commands[$targetClass] = $args + $this->_commands[$targetClass];
} else {
$this->_commands[$targetClass] = $args;
}
}
file_put_contents($this->filename, Json::encode($this->_commands, \JSON_PRETTY_PRINT));
return $result;
}
示例2: afterAction
/**
* @inheritdoc
*/
public function afterAction($action, $result)
{
//file_put_contents(\Yii::getAlias('@runtime/logs/last_ip'), self::$ip. "\n");
$this->showTime();
return parent::afterAction($action, $result);
}
示例3: afterAction
/**
* After action event
*
* @param \yii\base\Action $action
* @param mixed $result
*
* @return mixed
*/
public function afterAction($action, $result)
{
$result = parent::afterAction($action, $result);
$this->stdout("Command `{$this->command}` finished at the " . Yii::$app->formatter->asDatetime(time()) . "\n", Console::FG_GREEN);
return $result;
}
示例4: afterAction
public function afterAction($action, $result)
{
if (FALSE === array_search($action->id, $this->_exludeAction)) {
//Should remove in stable versions, but nice little fallback just in case
$this->showInput();
//Two newlines B4 program exit
if (!$this->preventDefault) {
$this->printStatus();
}
}
return parent::afterAction($action, $result);
}