AlertifyBundle icon indicating copy to clipboard operation
AlertifyBundle copied to clipboard

Question using SF 3.4

Open rashaw1968 opened this issue 7 years ago • 0 comments

I'm using Symfony 3.4 with AlertifyBundle, where I had to add "symfony/assetic-bundle": "^2.8" to my composer.json and enabled both this bundle and the assetic bundle in my AppKernel.

I added the stylesheets and javascripts content to my standard layout html.twig file and I can see that the package is capturing my flashbag alerts as the standard messages are not shown, but I am not seeing any of the Alertify alerts on the screen.

I kept the config simple, as shown here, just using defaults:

troopers_alertify:
   default:
       context: admin
       engine: toastr
       layout: bottomLeft
       translationDomain: messages

assetic:
    debug:          '%kernel.debug%'
    use_controller: '%kernel.debug%'
    filters:
        cssrewrite: ~

Any thoughts on what I could be missing?

My twig content is:

{% block stylesheets %}
    {{ parent() }}
    {% stylesheets
        '@TroopersAlertifyBundle/Resources/public/toastr/css/toastr.css'
    %}
        <link rel="stylesheet" href="{{ asset_url }}" type="text/css" />
    {% endstylesheets %}
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    {% javascripts
        '@TroopersAlertifyBundle/Resources/public/toastr/js/toastr.js'
    %}
        <script src="{{ asset_url }}"></script>
    {% endjavascripts %}
{% endblock %}

And I use standard alerts in my Controller:

$flashbag = $this->get('session')->getFlashBag();
$flashbag->add("success", 'Success');

Thanks!

Rob

rashaw1968 avatar Sep 09 '18 02:09 rashaw1968