That's fine. Then the controller needs to have a persistent method to hold
on to things like that.


On Fri, May 10, 2013 at 6:40 PM, Norv <notifications@github.com> wrote:

> In sources/Load.php:
>
> > @@ -2672,3 +2686,39 @@ function determineAvatar($profile, $max_avatar_width, $max_avatar_height)
> >
> >  	return $avatar;
> >  }
> > +
> > +/**
> > + * Load all of the membergroups
> > + *
> > + * @global array $smcFunc
> > + * @global array $context
> > + * @global array $modSettings
> > + */
> > +function loadMemberGroups($force = false)
>
> The execution of the script goes (ideally) like this:
>
>    - dispatching -> action_something() method
>       - which uses subs1, subs2, subs3
>       - and sends to template. Where do you see "a lot of calls to that"?
>       The action_something() method is a single method (sometimes two), so after
>       the call to getMembergroups(), it has the result, likely in $context. The
>       template has $context. I think in most cases the execution of the script
>       with core files alone has a single call to getMembergroups(). With addons
>       and integrated sites, it may have more calls for their own needs, but
>       that's a good thing, not a bad thing. Sharing data through $context with
>       external apps isn't cool, nor sharing internally for that matter. The API
>       exists to be used.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/elkarte/Elkarte/pull/380/files#r4180845>
> .
>