If You need some functionality in ALL controllers, then put this code
to AppController - copy file cake/app_controller.php to app directory
and put those methods to class AppController inside of file app/
app_controller.php

BUT: if not every controller of Your application is supposed to have
this functionality, You can consider use component, ie file app/
controllers/components/common.php with class CommonComponent extends
Object {
    var $controller = null;

    function startup(&$controller) {
        $this->controller =& $controller;
    }

    function something($xyz) {
        $name = $this->controller->name;
        ....
        ....
    }
}

and then in Your controllers
var $components = array('Common');

with usage inside of controller action like
$this->Common->something($blabla);


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to