The convention is to _underscore_private_methods. camelCased methods can't be accessed via URL.
some code
/**
* Sometimes it is useful to hide some actions, so they can't be accessed even though
* the dispatcher/router thinks the controller should invoke these methods.
*
* Basically this is a convenience-function built upon the filter-chaining. Therefore
* call $this->hideActions(...) from the controllers constructor just like any other
* beforeFilter.
*
* Examples:
*
* $this->hideActions('forbid,invisible')
* $this->hideActions(array('except'=>array('visible')) // all but 'visible'
* $this->hideActions(array('only' =>array('invisible'))
*
* @param mixed $mixed
*/
function hideActions($mixed)
{
if (is_array($mixed) && (isset($mixed['only']) || isset($mixed['except']))){
$condition = $mixed;
}else{
$actions = Ak::toArray($mixed);
$condition = array('only'=>$actions);
}
$this->beforeFilter(array('_forbidAction'=>$condition));
}
function _forbidAction()
{
//your code: throw an error or redirect
}
hope its useful
Ok, you've found a serious bug that we have introduced without realizing. I've just added some unit tests and fix this issue on rev.1145
Now _underscored_actions will be completely ignored by the router, so they will default to index. Regarding AkActionController actions you can't access them anymore.
Thanks for coming with this up!
1 to 7 of 7