> Is it possible to have an action which can only be called from within
> cake via requestAction? So the function is part of another controller
> but I don't want users to be able to call it directly...
It is possible. Just implement following method in Your controller and
Your methods YourController::action_one() and
YourController::action_two() will be executed only in case 'bare' call
- means ajax call from page or call through requestAction().
function beforeFilter() {
if (empty($this->params['bare'])) {
if (in_array($this->action, array('action_one', 'action_two')))
{
return $this->cakeError('privateAction', array(
array('className' => $this->name."Controller"),
'action' => $this->action,
'webroot' => $this->webroot,
'url' => $this->params['url']['url'],
'base' => $this->base))
);
}
}
}
Note: 'privateAction' is not exact description of this error, but it is
not point here ;-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---