This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
controllers/ | Thu Apr 09 10:23:52 -0700 2009 | |
| |
readme.txt | Mon Mar 23 11:54:01 -0700 2009 | |
| |
tests/ | Mon Mar 23 11:54:01 -0700 2009 |
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'
)
);







