cgView = new CgView(); $this->cgView->viewPath = KERNEL_DIR . "/views/widgets"; $this->data = $data; $this->init(); } public function run() { } public static function create(array $data = []): Widget { return new static($data); } protected function init() { } }