Re: User Bar Logic

2006-08-20 Thread AD7six
Simplerules wrote: > No matter what I do it won't work here is the code: > >//Get User Data; >$Profile = $this->Session->read('User'); > >if(isset($Profile['Username'])) >{ > $this->set('logged_in', TRUE); > $this->set('username', $Profile['Userna

Re: User Bar Logic

2006-08-20 Thread John Zimmerman [gmail]
Is 'Username' really capitalized as the table name in your schema?Cake conventions would make this lowercase.So if you made it lower case in the db schema, but then try to refer to it as sentence/camel case the variable Username would not actually exist because it is really 'username'. On 8/20/06,

Re: User Bar Logic

2006-08-20 Thread Simplerules
No matter what I do it won't work here is the code: //Get User Data; $Profile = $this->Session->read('User'); if(isset($Profile['Username'])) { $this->set('logged_in', TRUE); $this->set('username', $Profile['Username']); } else { $thi

Re: User Bar Logic

2006-08-20 Thread Simplerules
No matter what I do it won't work here is the code: //Get User Data; $Profile = $this->Session->read('User'); if(isset($Profile['Username'])) { $this->set('logged_in', TRUE); $this->set('username', $Profile['Username']); } else { $thi

Re: User Bar Logic

2006-08-20 Thread AD7six
Hi All, Let's look at it this way: 1) If a line of code like $this->set('Foo',$bar); is executed by any controller, a variable named $Foo will be available in the view/layout with the contents $bar. 2) If you define a method in your app_controller and in one of your controllers you override the

Re: User Bar Logic

2006-08-20 Thread JensWiese
I had the same problem and build a component which is rendered in the main template. works fine. Jens --~--~-~--~~~---~--~~ 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@

Re: User Bar Logic

2006-08-19 Thread John Zimmerman [gmail]
I am pretty sure I have something in one of my apps setting variables in app_controller and readin the info in the default template.  I will double check.What I am doing for login info though is setting it in the session and then checking for it in the default template. So you can always set a vari

Re: User Bar Logic

2006-08-19 Thread [EMAIL PROTECTED]
I understand why you would want to write it in the app_controler (so that all controllers might inherit from this). The problem is, there doesn't seem to be a way to declare variables outside of functions. And, as you probably are finding out, when a application controller inherits from the app_c

Re: User Bar Logic

2006-08-19 Thread Chris Hartjes
Can't you just set them like you would a regular variable in the controller and have it show up? i.e in the controller: $this->set('foo', $bar) On 8/19/06, Simplerules <[EMAIL PROTECTED]> wrote: > > Nobody? > > > > > -- Chris Hartjes "The greatest inefficiencies come from solving problems yo

Re: User Bar Logic

2006-08-19 Thread Simplerules
Nobody? --~--~-~--~~~---~--~~ 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 optio

User Bar Logic

2006-08-18 Thread Simplerules
I need to send 2 variables to the default template file, 1 to say wether a user is logged in and the other containing the username. I tried using appController to do this, with a beforeFilter, but it wasn't availible for the default template. Where could I put the logic code so that I could set