This repository has been archived on 2024-04-19. You can view files and clone it, but cannot push or open issues or pull requests.
crispage-lite/patch/core/components/Crispage/Components/MessagesComponent.php

42 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2023-12-07 14:07:15 -05:00
<?php
/*
Crispage CMS
crispycat <the@crispy.cat>
https://crispy.cat/software/crispage
Crispage is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
namespace Crispage\Components;
defined("ROOT") or die();
class MessagesComponent extends \Crispage\Response\Component {
public static function getExtensionInfo(): array {
return [
"id" => "crispage.components.messages",
"version" => VERSION
];
}
public function __construct(\Crispage $app, array $data) {
parent::__construct($app, $data);
}
public function render(): void {
?>
<div id="messages">
<?php foreach ($this->app->page->data["messages"] as $id => $msg) { ?>
<div id="msg_<?php echo $id; ?>" class="notification is-<?php echo $msg["color"]; ?> mb-2">
<?php echo $msg["content"]; ?>
</div>
<?php } ?>
</div>
<?php
}
}
?>