AjaxAction View Helper for Zend Framework

Synopsis

AjaxAction view helper is a plug-in replacement for the Action view helper. It transforms synchronous requests to asynchronous XHR-calls with no frills.

Installation (AjaxAction standalone)

Just copy the files AjaxAction.php to Your APPLICATION_PATH/views/helpers directory,  ajax.phtml to Your APPLICATION_PATH/views/_partials directory and make sure that the autoloader can load the helper. If You just created a Zend Framework project with Zend Studio or zf-command You should be fine without any modifications.

What JavaScript library You use is up to You, just modify the APPLICATION_PATH/views/_partials/ajax.phtml to work with Your library.

Usage

In view just replace

<?php echo $this->action('gettweets', 'content', null, array()); ?>

with this

<?php echo $this->ajaxAction('gettweets', 'content', null, array(), '_partials/ajax.phtml'); ?>

Installation (CacheAction standalone)

see project page

Links

Take a look at the AjaxAction view helper and CacheAction demo project on GitHub

Download the example Zend Framework project and have fun!

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • LinkedIn
  • Technorati
  • StumbleUpon
  • Reddit
  • RSS Feed
  • Google
  • Design Bump

One Response

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>