Wrapper around the PNotify plugin
Include CSS:, (*1)
<link href="pnotify.custom.min.css" media="all" rel="stylesheet" type="text/css" />
Include JS:, (*2)
<script type="text/javascript" src="pnotify.custom.min.js"></script>
Use it like this:, (*3)
<script type="text/javascript"> $(function(){ new PNotify({ title: 'Regular Notice', text: 'Check me out! I\'m a notice.' }); }); </script>
Composer.json, (*4)
Add this line: "alex198710/pnotify": "dev-master"
Config.yml, (*5)
assetic: assets: pnotify_js: inputs: - %kernel.root_dir%/../vendor/alex198710/pnotify/assets/js/pnotify.custom.min.js output: js/pnotify.js filters: [?yui_js] pnotify_css: inputs: - %kernel.root_dir%/../vendor/alex198710/pnotify/assets/css/pnotify.custom.min.css output: css/pnotify.css
Twig view:, (*6)
{% stylesheets '@pnotify_css' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %}
{% javascripts '@pnotify_js' %} <script type="text/javascript" src="{{ asset_url }}"></script> {% endjavascripts %}Then use it like this:<script type="text/javascript"> $(function(){ new PNotify({ title: 'Regular Notice', text: 'Check me out! I\'m a notice.' }); }); </script>