Код: Выделить всё
public function events()
{
return array_merge(parent::events(),array(
'onBeginRequest'=>'beginRequest',
));
}
public function beginRequest($event){...}
Код: Выделить всё
public function events()
{
return array_merge(parent::events(),array(
'onBeginRequest'=>'beginRequest',
));
}
public function beginRequest($event){...}
Код: Выделить всё
namespace app\components;
use yii\base\BootstrapInterface;
class MyComponent implements BootstrapInterface
{
public function bootstrap($app) { ... }
}
Код: Выделить всё
return [
'bootstrap' => ['log', 'app\components\MyComponent'],
...
];