Hi!

I'm just thinking about moving an App i'm working on to CakePHP 1.2 so
that I can enjoy some of the new features... I seem to have fallen at
the first hurdle though!

In my existing app (for 1.1) I define some functions in my /app/
app_controller.php for use elsewhere. E.g.:

class AppController extends Controller {
  function isAdmin() {
    return isset($this->params['admin']);
  }
}

Then from my other controllers (which extend AppController), I can
have things which call it:

class SomeController  extends AppController {
  function doSomething() {
    if ($this->isAdmin()) {
      // blah
    }
}

This works fine in 1.1, but causes a "Call to undefined method
SomeController::isAdmin()" in CakePHP 1.2

I can't really think of a better way to do things like that without
duplicating lots of code (which I do my best to avoid at all times) so
would like a way to make the Controllers inherit function properly
from their parent objects...

Please help!

Thanks

Seb
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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