1.在app\components下新建MyComponent.PHP namespace app\components; use Yii; use yii\base\Component; use yii\base\InvalidConfigException; class MyComponent extends Component { public function welcome() { echo "Hello..Welcome to MyComponent"; } } 2.在co
basic\components\HelloWidget namespace app\components; use yii\base\Widget; use yii\helpers\Html; class HelloWidget extends Widget { public $message; public function init() { parent::init(); if ($this->message === null) { $this->message = '您好'; } }
相关类手册: http://www.yiichina.com/api/CButtonColumn buttons 属性 public array $buttons; the configuration for additional buttons. Each array element specifies a single button which has the following format: 'buttonID' => array( 'label'=>'...', // text