-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathmessage.php
37 lines (27 loc) · 1.43 KB
/
message.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
namespace Atk4\Ui\Demos;
/** @var \Atk4\Ui\App $app */
require_once __DIR__ . '/../init-app.php';
$img = 'https://github.com/atk4/ui/raw/07208a0af84109f0d6e3553e242720d8aeedb784/public/logo.png';
\Atk4\Ui\Header::addTo($app, ['Message Types']);
$seg = \Atk4\Ui\View::addTo($app, ['ui' => 'raised segment']);
$barType = \Atk4\Ui\View::addTo($seg, ['ui' => ' basic buttons']);
$msg = \Atk4\Ui\Message::addTo($seg, [
'This is a title of your message',
'type' => $seg->stickyGet('type'),
'icon' => $seg->stickyGet('icon'),
]);
$msg->text->addParagraph('You can add some more text here for your messages');
$barType->on('click', '.button', new \Atk4\Ui\JsReload($seg, ['type' => (new \Atk4\Ui\Jquery())->text()]));
\Atk4\Ui\Button::addTo($barType, ['success']);
\Atk4\Ui\Button::addTo($barType, ['error']);
\Atk4\Ui\Button::addTo($barType, ['info']);
\Atk4\Ui\Button::addTo($barType, ['warning']);
$barIcon = \Atk4\Ui\View::addTo($seg, ['ui' => ' basic buttons']);
$barIcon->on('click', '.button', new \Atk4\Ui\JsReload($seg, ['icon' => (new \Atk4\Ui\Jquery())->find('i')->attr('class')]));
\Atk4\Ui\Button::addTo($barIcon, ['icon' => 'book']);
\Atk4\Ui\Button::addTo($barIcon, ['icon' => 'check circle outline']);
\Atk4\Ui\Button::addTo($barIcon, ['icon' => 'pointing right']);
\Atk4\Ui\Button::addTo($barIcon, ['icon' => 'asterisk loading']);
\Atk4\Ui\Button::addTo($barIcon, ['icon' => 'vertically flipped cloud']);