Message

class phpctrl\ui\Message

Outputs a rectangular segment with a distinctive color to convey message to the user, based around: https://semantic-ui.com/collections/message.html

Demo: http://demo.phpcontrols.com/ui/message.php

Basic Usage

Implements basic image:

$message = new \phpctrl\ui\Message('Message Title');
$app->add($message);

Although typically you would want to specify what type of message is that:

$message = new \phpctrl\ui\Message(['Warning Message Title', 'warning']);
$app->add($message);

Here is the alternative syntax:

$message = $app->add(['Message', 'Warning Message Title', 'warning']));

Adding message text

property phpctrl\ui\Message::$text

Property $text is automatically initialized to Text so you can call Text::addParagraph to add more text inside your message:

$message = $app->add(['Message', 'Message Title']);
$message->addClass('warning');
$message->text->addParagraph('First para');
$message->text->addParagraph('Second para');

Message Icon

property phpctrl\ui\Message::$icon

You can specify icon also:

$message = $app->add([
    'Message',
    'Battery low',
    'red',
    'icon'=>'battery low'
])->text->addParagraph('Your battery is getting low. Recharge your Web App');