-
Notifications
You must be signed in to change notification settings - Fork 2
Bugs and incomplete tutorial #36
Copy link
Copy link
Open
Description
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');
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels