Headers, Footers, Menu (jedd approach) - the saga continues. |
[eluser]squeakita[/eluser]
I am a complete newbie, please forgive any stupid questions. I am trying to setup this approach for the header/footer/menu. Here is the error I am getting: Code: Message: Undefined variable: main_menu_view here is MY_controller Code: class MY_Controller extends Controller { Here is the template view: Code: <html> Here is the controller I am trying to test it on: blog Code: class Blog extends MY_Controller { Code: <h1>boo!</h1> Please help, what am I missing? I think once the light goes off, I should be able to code quickly. But I always stumble initially to understand the entire picture. I am just so use to doing it the way I'e done it for 10 years, I didn't have to think. Now I have to think - this seems very foreign to me.. :bug: Thank you for your time!
[eluser]Mischievous[/eluser]
ummm... try doing: Code: class MY_Controller extends Controller { Code: class Blog extends MY_Controller {
[eluser]squeakita[/eluser]
Thank you, for helping - I continue to get the same error. I took what you have and tinkered a bit, as I was getting an error with Undefined variable: tmp_data Here is what I have working. Code: class MY_Controller extends Controller { Code: class Blog extends MY_Controller { I do not understand enough yet to determine if this will create limitations in the future. But it is nice to have this little piece working - Again Thanks.
[eluser]InsiteFX[/eluser]
May be PHP open short tags are turned off! InsiteFX
[eluser]tonanbarbarian[/eluser]
Undefined variable: tmp_data is because you have not defined $tmp_data as an array but are treating it as such either of these 2 following options would fix the issue Code: class MY_Controller extends Controller { or Code: class MY_Controller extends Controller { you should really declare $this->data as an array as well Code: class MY_Controller extends Controller {
[eluser]squeakita[/eluser]
thank you for the help! #1 Short Tags are turned on and working - thanks for the pointer. #2 By declaring that variable in the My_controller, it is the always declared as long as I am using MY_Controller, is that correct? In other words, declare it in one place and use it through out the application? Thanks again! |
Welcome Guest, Not a member yet? Register Sign In |