Webino Examples

Showcase of Webino™ prototype usage.


API

Config

Config App Bootstrap Bind
Config App Bootstrap Bind Core
Config Debugger Info
Config Debugger Panel
Config Feature
Config Filesystem
Config Log Custom
Config Log Filter Priority
Config Log Filter Regex
Config Log XML
Config Mail TODO
Config Module TODO
Config Route
Config Route Segment TODO
Config Service Factory
Config Service Factory Override
Config Service Invokable
Config Service Invokable Override

Console

Console
Console Add Art
Console Animation
Console Animation Custom
Console Bind
Console Border
Console Checkboxes
Console Checkboxes Assoc
Console Columns
Console Command
Console Confirm
Console Draw
Console Dump
Console Flank
Console Formatting
Console Input
Console Input Accept
Console Input Accept Closure
Console Input Default
Console Input Multi Line
Console Json
Console Padding
Console Password
Console Progress
Console Progress Labels
Console Progress Manually
Console Radio
Console Radio Assoc
Console Table

Debugger

Debugger
Debugger Bar Dump
Debugger Death Screen
Debugger Dump
Debugger Info
Debugger Info Config
Debugger Panel
Debugger Panel Config
Debugger Timer

Events

Events App Custom Event
Events App Custom Event Object
Events Aware
Events Bind App Bootstrap
Events Bind App Bootstrap Config
Events Bind App Bootstrap Core
Events Bind App Bootstrap Core Config
Events Bind App Configure
Events Bind App Dispatch

Filesystem

Filesystem Aware
Filesystem Config
Filesystem Copy Rename
Filesystem Delete
Filesystem Directories
Filesystem Listing
Filesystem Metadata
Filesystem Streams
Filesystem Write Read

Logger

Logger Aware
Logger Aware Custom
Logger ChromePHP
Logger Custom
Logger Filters Priority
Logger Filters Regex
Logger FirePHP
Logger Message
Logger Message Class
Logger PSR 3
Logger XML

Mail

Mail Config TODO

Modules

Modules Config TODO
Modules Console Command
Modules Debugger
Modules Dependencies

Response

Response JSON
Response Text
Response View TODO
Response XML

Route

Route Bind Aggregate Class
Route Bind Aggregate Object
Route Bind Closure
Route Bind Invokable Class
Route Bind Invokable Object
Route Config
Route Segment TODO

Service

Service Factory Class
Service Factory Class Invokable
Service Factory Closure
Service Factory Config
Service Factory Config Invokable
Service Factory Config Override
Service Factory Object
Service Factory Object Invokable
Service Invokable Class
Service Invokable Config
Service Invokable Config Override
Service Invokable Object

View

View Component Coffee Machine TODO
View Component Counter
View Component Counter Ajax
View Component TODO
View Credits
View Layout TODO
View Template TODO

Cookbook

TODO...

Applications

TODO...
Source Preview
<?php
/**
 * Webino Examples
 */

use WebinoAppLib\Event\DispatchEvent;
use 
WebinoAppLib\Event\RouteEvent;
use 
WebinoAppLib\Response\ViewResponse;
use 
WebinoAppLib\Router\DefaultRoute;
use 
WebinoAppLib\View\SourcePreviewComponent;
use 
WebinoDomLib\Event\RenderEvent;
use 
WebinoHtmlLib\Html;
use 
WebinoViewLib\Component\AbstractViewComponent;
use 
WebinoViewLib\Component\OnDispatchInterface;
use 
WebinoViewLib\Component\Stylesheet;
use 
WebinoViewLib\Feature\CommonView;
use 
WebinoViewLib\Feature\NodeView;

require 
__DIR__ '/../vendor/autoload.php';

/**
 * Custom view component
 */
class ExamplesComponent extends AbstractViewComponent implements OnDispatchInterface
{
    
/**
     * @var string
     */
    
private $api;

    
/**
     * @param NodeView $node
     */
    
public function configure(NodeView $node)
    {
        
$node->setLocator('examples');
    }

    
/**
     * @param DispatchEvent $event
     */
    
public function onDispatch(DispatchEvent $event)
    {
        
$examples = [];
        foreach (
$event->getApp()->file()->listContents() as $info) {
            if (
'dir' !== $info['type']) {
                continue;
            }

            list(
$section) = explode('-'$info['filename'], 2);
            
$label ucwords(str_replace('-'' '$info['filename']));
            
$examples[ucfirst($section)][] = new Html\Url($info['filename'], $label) . new Html\LineBreak;
        }

        
$this->api '';
        foreach (
$examples as $section => $items) {
            
$this->api .= new Html\Title4($section);
            foreach (
$items as $item) {
                
$this->api .= $item;
            }
            
$this->api .= new Html\LineBreak;
        }
    }

    
/**
     * @param RenderEvent $event
     */
    
public function onRender(RenderEvent $event)
    {
        
$col = (new Html\Block)->setClass('col-md-4');

        
$event->getNode()->replace([
            (new 
Html\Block([
                new 
Html\Title('Webino Examples'),

                (new 
Html\Text('Showcase of :link prototype usage.'))
                    ->
format([':link' => new Html\Url('https://github.com/webino/Webino''Webino™')])
            ]))->
setClass('text-center'),

            new 
Html\HorizontalLine,
            (clone 
$col)->setValue(new Html\FieldSet(new Html\Title2('API'), new Html\Html($this->api))),
            (clone 
$col)->setValue(new Html\FieldSet(new Html\Title2('Cookbook'), 'TODO...')),
            (clone 
$col)->setValue(new Html\FieldSet(new Html\Title2('Applications'), 'TODO...')),
        ]);
    }
}

$config Webino::config([
    new 
CommonView([
        new 
Stylesheet\BootstrapV3,
        new 
SourcePreviewComponent(__FILE__),

        (new 
NodeView('content'))
            ->
setLocator('body')
            ->
setHtml('<div class="container jumbotron"><examples/></div><source-preview/>'),

        new 
ExamplesComponent,
    ]),
]);

$app Webino::application($configWebino::debugger(Webino::debuggerOptions()->setBar()))->bootstrap();

$app->bind(DefaultRoute::class, function (RouteEvent $event) {
    
$event->setResponse(new ViewResponse);
});

$app->dispatch();