No, you cannot access ANYTHING from the controller in the model -
that's one of the core parts of MVC.

What you should do is define a new function in your model -
register()  This can set some class variable which you can check in
your other callbacks, eg:

class YourModel extends AppModel {

        var $name = 'YourModel';

        var $is_registering = false;

        function register( $data )
        {
                $this->is_registering = true;
                return $this->save( $data );
        }

        function beforeValidate()
        {
                if ( $this->is_registering ){
                        ...
                }
        }

        function afterSave()
        {
                if ( $this->is_registering ){
                        ...
                }
        }
}



On Nov 18, 6:35 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> It would be great, but model doesn't have field action :/ Any other
> ideas how to check action in model?
--~--~---------~--~----~------------~-------~--~----~
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