1. in Cake conventions, function prefixed with __ is private, so
you're correct

2. if you need to access a function from several controllers, don't
put it in a specific one, move it to app_controller.php.
Since all your controllers extend AppController, $this-
>__validateLogin() is OK
IMHO a validateLogin() function is more in a Model than in a
Constroller, but depends of what you're doing in it.

3. just override beforeFilter in your controller, and you'll have
access to controller's variables with $this.
Maybe I don't understand well your question here...

On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
> Hi There,
>
> I just started using cake, and having heavy troubles getting some
> basic things to work....
>
> 1. How do I define a function without a view?
> I read somewhere on the net, that these actions/functions start with a
> double underscore...
> example: function __validateLogin()
> Is this okay?
>
> 2. How to access the function defined in 1 from other Controllers?
> In the same controller i simply use $this->__validateLogin();
> But in other controllers?
>
> 3. How to get infos from the API?
> e.g. i tried to get informations, what parameters could be used in the
> beforeFilter function...
> I simply searched the api for "beforeFilter" and found the first entry
> useful : "Controller::beforeFilter()";
> But on line 1127 of file controller.php only
>
> 01123 /**
> 01124  * Called before the controller action.  Overridden in
> subclasses.
> 01125  *
> 01126  */
> 01127     function beforeFilter() {
> 01128     }
>
> Nothing more... Wher can I find the source to get the params section?
>
> Perhaps someone could help me and describes how to solve this...
>
> Greetings,
> Alexander


--~--~---------~--~----~------------~-------~--~----~
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