public
Description: CakePHP component that adds fine grained controls to controller callbacks. NO LONGER MAINTAINED HERE. MOVED TO http://codaset.com/joelmoss/cakephp-callbacks
Homepage: http://codaset.com/joelmoss/cakephp-callbacks
Clone URL: git://github.com/joelmoss/cakephp-callback.git
name age message
directory controllers/ Thu Apr 09 10:23:52 -0700 2009 Fixed bug that caused some callbacks to be missed [joelmoss]
file readme.txt Mon Mar 23 11:54:01 -0700 2009 First commit of callback component [joelmoss]
directory tests/ Mon Mar 23 11:54:01 -0700 2009 First commit of callback component [joelmoss]
readme.txt
Callback Component

This component extends the CakePHP callbacks architecture, by supporting
callbacks in class properties.

Simply define any of the three callbacks defined in CallbackComponent::__callbacks
like this:

  class MyController extends AppController {
      var $beforeFilter = array('myCallback');
      function _myCallback() {
          # do something here
      }
  }

You can declare as many callbacks as you wish:

  class MyController extends AppController {
      var $beforeFilter = array('myCallback', 'anotherCallback', 'andAnotherOne');

Callbacks also support a number of options, which are passed to the callback:

  'only' An array of controller actions that this callback should be called on.
  'except' An array of controller actions that the callback will NOT be called on.
  'if' a method name, which returns true|false. Callback will only be run if method is true.
  'unless' a method name, which returns true|false. Callback will not be run if method is true.

  Example:

  class MyController extends AppController {
      var $beforeFilter = array(
          'myCallback' => array(
              'only' => array('index', 'view'),
              'if' => 'ifMethod'
          )
      );