<?php namespace appActions; use yiiaseAction; class GzhAppFormatOutput extends Action { public $objectsToFormat;
public $id;
public function run() {
return "Hello world!"; } }
在调用时:
public function actions()
{
return [
'about' => [
'class' => 'appactionsGzhAppFormatOutput',//此处要注意actions一定是GzhAppFormatOutput.php所在的文件夹
'objectsToFormat' => 'abc',
'id' => '123',],];
}