Re: AppController's beforeFilter question

2006-10-24 Thread fr3nch13

i knew this, i just thought cake may have done it differently
considering it was the AppController and beforeFilter was a 'special'
method.

nate wrote:
> See here:
> 
> http://www.php.net/manual/en/keyword.parent.php


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



Re: AppController's beforeFilter question

2006-10-24 Thread Brian French




Touché...

I had the below code code.


class AppController extends Controller
{
    function beforeFilter()
    {
        echo "AppController::BeforeFilter";
    }
}
class ReviselogsController extends AppController
{
    function beforeFilter()
    {
        echo "ReviselogsController::BeforeFilter";
    }
}
?>

I ran the code via http://localhost/reviselogs/index and it only echoed
the ReviselogsController. So, you should call the parent if you need to
(i thought maybe cake would run both anyways). Below is the adjusted
code. Depending on the situation, you may need to call the parent
before any actions, or call it after all of the actions 


class ReviselogsController extends AppController
{
    function beforeFilter()
    {
        parent::beforeFilter();
   echo "ReviselogsController::BeforeFilter";
    }
}
?>

This also helps another thread i started, which could make it's answer
even more simple:
http://groups.google.com/group/cake-php/browse_frm/thread/ad985831c21147f2/d142b2ce2fe432b4#d142b2ce2fe432b4

(posed to the list for a searchable reference)

Samuel DeVore wrote:

  you should try a test, and let us know
On 10/24/06, Brian French <[EMAIL PROTECTED]> wrote:
  
  
When i have an AppController set with the method beforeFilter as well as
another normal controller (TasksController).

Does the beforeFilter in the TasksController:
a. overwrite the AppController's beforeFilter
b. run before the AppController's beforeFilter
c. run after the AppController's beforeFilter

(no this isn't a quiz :-p)


  
  

  


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





Re: AppController's beforeFilter question

2006-10-24 Thread nate

See here:

http://www.php.net/manual/en/keyword.parent.php


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



Re: AppController's beforeFilter question

2006-10-24 Thread Samuel DeVore

you should try a test, and let us know
On 10/24/06, Brian French <[EMAIL PROTECTED]> wrote:
>
> When i have an AppController set with the method beforeFilter as well as
> another normal controller (TasksController).
>
> Does the beforeFilter in the TasksController:
> a. overwrite the AppController's beforeFilter
> b. run before the AppController's beforeFilter
> c. run after the AppController's beforeFilter
>
> (no this isn't a quiz :-p)
>
> >
>


-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

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



AppController's beforeFilter question

2006-10-24 Thread Brian French

When i have an AppController set with the method beforeFilter as well as 
another normal controller (TasksController).

Does the beforeFilter in the TasksController:
a. overwrite the AppController's beforeFilter
b. run before the AppController's beforeFilter
c. run after the AppController's beforeFilter

(no this isn't a quiz :-p)

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