Tutorial code at README.md does not work and requires grepping framework code to run (for example there is no setText for view anymore), no vendor autoload code, no use paths. I think it should work out of the box. Like this:
<?php
declare(strict_types=1);
require_once(__DIR__."/vendor/autoload.php");
use Fohn\Ui\View;
use Fohn\Ui\App;
use Fohn\Ui\Page;
use Fohn\Ui\PageLayout\SideNavigation;
use Fohn\Ui\PageException;
use Fohn\Ui\Service\Ui;
// Create and boot service.
Ui::service()->boot(function (Ui $ui) {
$ui->setApp(new App());
// Add default exception handler.
$ui->setExceptionHandler(PageException::factory());
// Set page.
$page = Page::factory(['title' => 'My Fohn-ui Project']);
$page->addLayout(SideNavigation::factory(['topBarTitle' => 'My Fohn-Ui App']));
$ui->initAppPage($page);
});
View::addTo(Ui::layout())->setTextContent('Hello World');