Yii PNotify Extension

I have been using the PNotify extension in my Yii project and have had a good experience with it. PNotify is a JQuery extension that you can use to show notifications for you site. I use it when a user saves a form or deletes a record. Any interactions that require some type of response from the server. The Yii extensions makes it even easier to use this JQuery plugin. When you install the plugin all you have to do as add it to all your pages you are going to be using it on. For my project I added it to the layouts header file. You can add it to whatever page works best for you site


<?php $this->widget('application.extensions.PNotify.PNotify', array('flash_messages_only' => true,)); ?>

If you need to use it as a ajax response you can do that also. Since you included it as part of the header the javascript will already be available on the page. You can simply do this.


parent.$.pnotify({'type':'success','title':response.title,'text':response.message});

As you can see this extension is very easy to use and can add a nice message module to your interface. I encourage you to check it out as it looks better than your typical popup or flash notification.

Leave a Reply

Your email address will not be published. Required fields are marked *