Common PHP vars in initPages()

3 views
Skip to first unread message

mozmac

unread,
Apr 6, 2008, 11:03:21 AM4/6/08
to zoop-users
I have a question / request:

In the "initPages()" function in a zone, is it possible to set a
variable like $person that can be used by every page function within
the zone? Right now I run getLoggedInUser() inside every single page,
but it would be nice to run it once in initPages() and then somehow
pass it on to the other functions. I know I could declare it
globally, but I would like to avoid that.

Just a question. It's not super important.

Mark

Rick Gigger

unread,
Apr 6, 2008, 6:22:40 PM4/6/08
to zoop-...@googlegroups.com
Yeah, that's easy. Just say $this->person = getLoggedInUser() in
initPages. Then $this->person should be set on each of the page or
post functions in the zone.

Rick

Mark Suman

unread,
Apr 7, 2008, 12:27:09 AM4/7/08
to zoop-...@googlegroups.com
Oh duh, that's great.  Thanks.  I knew it had to be something simple I was overlooking.

Mark
Reply all
Reply to author
Forward
0 new messages