Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • I mean I guess instead of $this->setup = $setup I could even do $this->App = $setup['App'] and $this->Database = $setup['Database'] Commented Oct 6, 2011 at 16:36
  • This looks like a great answer all in all. Might need some major rewrites. Where would i create the App object? I start using App right way over here: github.com/maniator/SmallFry/blob/master/config/app_config.php Commented Oct 6, 2011 at 16:38
  • 1
    Array as form of dependency injection container. Commented Oct 6, 2011 at 16:44
  • 1
    @Neal Glad you like it, I was a bit worried it was too much change. For that its hard for me to tell. Would they be the default values for your App object in the AppController class? Now the thinking becomes constructing the entire object at initialisation, so if you are creating it from AppController you should probably know exactly how you want it setup? This may also lead you to doing less in your constructor. Commented Oct 6, 2011 at 16:50
  • 1
    @Paul Can I ask why you don't type-hint 'App' in the constructor, and instead check in the constructor instead? Is there an architectural reason for this? Commented May 19, 2013 at 18:38