To start you can try something like this.
Be careful, this is directly wrote from forum and not tested ;o))
class bootstrapGrowl {
private $message;
private $type;
public function __construct($message, $type)
{
$this->message = $message;
$this->type = $type;
return $this;
}
/** GETTERS & SETTERS */
...
}
class indexController extends Phalcon\Mvc\Controller{
public function indexAction()
{
$growContainer = array();
$growMessage1 = new bootstrapGrowl('my first message', 'info');
$growContainer[] = $growMessage1;
$growMessage2 = new bootstrapGrowl('my second message', 'danger');
$growContainer[] = $growMessage2;
$this->view->growContainer = $growContainer;
}
}
{# Views/index/index.volt #}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.js"></script>
<script type="text/javascript" src="https://ifightcrime.github.io/bootstrap-growl/jquery.bootstrap-growl.min.js"></script>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script type='text/javascript'>
$(window).load(function(){
$(function() {
{% for growMessage in growContainer %}
$.bootstrapGrowl(
"{{ growMessage.getMessage() }}",
{
type: '{{ growMessage.getType() }}', // (null, 'info', 'danger', 'success')
}
);
{% endfor %}
});
});
</script>
</head>
<body>
</body>
</html>