Just prefix your internal controller methods with an underscore. Then
they won't be accessible as actions.

class SomeController extends AppController {
  function do_something() {
    // this is an action
    $foo = $this->_do_something_internally();
  }

  function _do_something_internally() {
    // This cannot be called as an action
  }
}

> Is there any way to overcome these problems? Do I need to code the
> methods in a separate class, or would that defy the point of the MVC
> framework?

If the methods you are using are to be shared amongst several
controllers and you end up duplicating code, you're better off
creating a component. But if it's just one controller, this is the
best method.

On Apr 30, 9:27 am, Dovdimus Prime <[EMAIL PROTECTED]> wrote:
> Hi there
>
> I'm working on adding functionality to a controller and if I were
> coding any other platform I would be wrapping functionality up in
> methods. However, I can see there are two potential problems doing
> this in my controller:
>
> a) The method would be available to the user from the address bar.
>
> b) The method would expect to lead to a view, which I don't want it
> to.
>
> Is there any way to overcome these problems? Do I need to code the
> methods in a separate class, or would that defy the point of the MVC
> framework?
>
> Thanks
>
> David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to