/** * 初始化 */ public function init() { Yii::$container->set('yii\\widgets\\LinkPager', ['firstPageLabel' => '首页', 'lastPageLabel' => '尾页', 'prevPageLabel' => '上页', 'nextPageLabel' => '下页', 'hideOnSinglePage' => false, 'options' => ['class' => 'pagination pull-right']]); Yii::$container->set('yii\\data\\Pagination', ['defaultPageSize' => 15]); Yii::$container->set('yii\\grid\\ActionColumn', ['template' => '{update} {delete}']); Yii::$container->set(ActiveForm::className(), ['type' => ActiveForm::TYPE_HORIZONTAL]); Yii::$container->set('yii\\captcha\\Captcha', ['captchaAction' => 'home/captcha']); Yii::$container->set('yii\\captcha\\CaptchaValidator', ['captchaAction' => 'home/captcha']); Yii::$container->set('backend\\behaviors\\TestBehavior', ['msg' => 'xxxxxxx']); }