Commit 03fccb79 authored by dj3c1t's avatar dj3c1t

messages

parent a4d78cfc
<?php
namespace Dj3c1t\AppBundle\Controller\View;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class MessagesController extends Controller {
public function displayAction() {
$messages = array(
"error" => array(),
"warning" => array(),
"success" => array(),
);
foreach($this->get('session')->getFlashBag()->get('error', array()) as $message) {
$messages["error"][] = $message;
}
foreach($this->get('session')->getFlashBag()->get('warning', array()) as $message) {
$messages["warning"][] = $message;
}
foreach($this->get('session')->getFlashBag()->get('success', array()) as $message) {
$messages["success"][] = $message;
}
return $this->render(
'Dj3c1tAppBundle::messages.html.twig',
array(
"messages" => $messages,
)
);
}
}
......@@ -204,6 +204,18 @@ section .main {
/* ---- messages */
.alert-error {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.alert-error hr {
border-top-color: #e4b9c0;
}
.alert-error .alert-link {
color: #843534;
}
.simple_tag {
padding: 4px 9px;
font-size: 90%;
......
......@@ -43,7 +43,7 @@
{% endblock %}
</header>
<div class="main">
{{ render(controller('Dj3c1tAppBundle:View/Messages:display')) }}
{{ include('Dj3c1tAppBundle::messages.html.twig') }}
{% block main %}
{% endblock %}
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment