Skip to content

Bugs and incomplete tutorial #36

@woodholly

Description

@woodholly

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions