Sure. You can use the controller callback functions in app_controller,
listed here: http://tempdocs.cakephp.org/#TOC52711
So try doing something like:
function beforeFilter()
{
/* Super controller logic that accesses a function in app_model or
something */
return true;
}
If you need to access a model every time you run a controller action,
you may want to add:
var $uses('NecessaryModel');
to your app_controller as well.
-Casey
On Dec 21, 10:33 am, carSign <[EMAIL PROTECTED]> wrote:
> Hi -
>
> So I am trying to include a small snippet of code in each page of my
> site. Is there a way to do this without modifying each controller?
>
> For example - I want to log visitors to my site. Each page visited
> would have some information put into the database.
>
> URL
> User info
> tiestamp
> browser info
>
> Can I do this using the app_controller? Can it be done without the
> need to modify all of my existing controllers?
> If I include it in the app_controller do I name that action 'index'?
> do I then create a app_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
-~----------~----~----~----~------~----~------~--~---