PHP Classes

File: demos/example.php

Recommend this page to a friend!
  Classes of Francesco Danti   ATK4 PHP Debug Bar   demos/example.php   Download  
File: demos/example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ATK4 PHP Debug Bar
Output debug information using PHP DebugBar
Author: By
Last change:
Date: 5 years ago
Size: 664 bytes
 

Contents

Class file image Download
<?php

include 'bootstrap.php';

use
atk4\ui\App;

$app = new App([
   
'title' => 'Agile UI - DebugBar',
]);

$app->initLayout('Centered');
$app->add($debugBar = new ATK4PHPDebugBar\DebugBar());
$debugBar->setAssetsResourcesUrl('../');
$debugBar->addDefaultCollectors();

$loader = $app->add('Loader');

$loader->set(function ($l) {
   
$number = rand(1, 100);
   
$l->app->getDebugBarCollector('messages')->addMessage('new message :'.$number);

   
$l->add(['Text', 'random :'.$number]);
});

/** @var Button $button */
$button = $app->add(['Button', 'test']);
$button->on('click', function ($j) use ($loader) {
    return
$loader->jsReload();
});

$app->run();