Re: pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread Miles J
As a personal preference, I would store it in the session. This way it can be accessed outside of the controller as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send em

Re: pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread sbeam
On Apr 10, 11:16 am, qwanta wrote: > I am setting a variable value that in app_controller beforeFilter, and > I would like to access it in all child controllers beforeFilter > function. > > class AppController extends Controller { >   var $components = array('Auth'); >   var $uses = array('User')

Re: pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread qwanta
OK, nevermind. Sure enough the second I post, I come up with a solution (after struggling all morning on the problem). class AppController extends Controller { var $auth_role; } then refer to it as $this->auth_role in all controllers. On Apr 10, 11:16 am, qwanta wrote: > I am setting a variab

pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread qwanta
I am setting a variable value that in app_controller beforeFilter, and I would like to access it in all child controllers beforeFilter function. class AppController extends Controller { var $components = array('Auth'); var $uses = array('User'); $auth_id = $this->Auth->user('id'); if (