Horde_Notification_Listener_Status::notify PHP Method

notify() public method

Outputs the status line if there are any messages on the 'status' message stack.
public notify ( array $events, array $options = [] )
$events array The list of events to handle.
$options array An array of options. Not used.
    public function notify($events, $options = array())
    {
        if (!count($events)) {
            return;
        }
        echo '<ul class="notices">';
        foreach ($events as $event) {
            echo '<li>' . $event . '</li>';
        }
        echo '</ul>';
    }

Usage Example

Esempio n. 1
0
 public function testMethodNotifyHasOutputEventMessagesEmbeddedInUlElement()
 {
     $listener = new Horde_Notification_Listener_Status();
     $event = new Horde_Notification_Event('test');
     $messages = array($event);
     $this->expectOutputString('<ul class="notices"><li>test</li></ul>');
     $listener->notify($messages);
 }
Horde_Notification_Listener_Status