<?php

use yii\helpers\Html;

?>

<?php if($display && $message): ?>
    <div class="alert alert-<?= $type ?>">
        <?php if(isset($title) && $title): ?>
            <h4>
                <?php if($icon): ?>
                    <i class="icon fa fa-<?= $icon ?>"></i>
                <?php endif; ?>
                <?= $title ?>
            </h4>
        <?php endif; ?>
        <p>
            <?php if((!isset($title) || !$title) && $icon): ?>
                <i class="icon fa fa-<?= $icon ?>"></i>
            <?php endif; ?>
            <?php if(is_array($message)): ?>
                <?php foreach($message as $key => $mess): ?>
                    <?= nl2br($mess); ?>
                    <?php if($key !== array_key_last($message)): ?><br /><?php endif; ?>
                <?php endforeach; ?>
            <?php else: ?>
                <?= nl2br($message); ?>
            <?php endif; ?>
        </p>
        <?php if(isset($buttonClose) && $buttonClose): ?>
            <a href="<?= Yii::$app->urlManager->createUrl(['producer/update-alert-message-read-at']) ?>" class="close"><span aria-hidden="true">×</span></a>
        <?php endif; ?>
    </div>
<?php endif; ?>