2024-08-30 12:27:46 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace kernel;
|
|
|
|
|
|
|
|
class Widget
|
|
|
|
{
|
|
|
|
|
|
|
|
protected CgView $cgView;
|
|
|
|
protected array $data;
|
|
|
|
|
|
|
|
public function __construct(array $data = [])
|
|
|
|
{
|
|
|
|
$this->cgView = new CgView();
|
2024-12-16 14:26:13 +03:00
|
|
|
$this->cgView->viewPath = KERNEL_DIR . "/views/widgets";
|
2024-08-30 12:27:46 +03:00
|
|
|
|
|
|
|
$this->data = $data;
|
|
|
|
|
|
|
|
$this->init();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function create(array $data = []): Widget
|
|
|
|
{
|
|
|
|
return new static($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function init()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|