# Get('settings') vs use ($settings)

**URL:** <https://discourse.slimframework.com/t/get-settings-vs-use-settings/1022>\
**Category:** Questions\
**Created:** [December 22, 2016, 12:06am UTC](https://discourse.slimframework.com/t/get-settings-vs-use-settings/1022 "2016-12-22T00:06:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SVL](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@SVL](https://discourse.slimframework.com/u/SVL)\
**Post date:** [December 22, 2016, 12:06am UTC](https://discourse.slimframework.com/t/get-settings-vs-use-settings/1022/1 "2016-12-22T00:06:25Z")

</div>

Just wondering if there is anything I should know about these two.  
Is there one to avoid or are both equally accepted and just a matter of personel preference?

$container[‘view’] = function ($container) {  
$settings = $c-\>get(‘settings’);  
$view = new \Slim\Views\Twig($settings[‘view’][‘template\_path’], $settings[‘view’][‘twig’]);  
return $view;  
};

$container[‘view’] = function ($container) use ($settings) {  
$view = new \Slim\Views\Twig($settings[‘settings’][‘view’][‘template\_path’], $settings[‘settings’][‘view’][‘twig’]);  
return $view;  
};

---

<div class="post-metadata">

**Author:** ![llvdl](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/llvdl/32/78_2.png) [@llvdl](https://discourse.slimframework.com/u/llvdl)\
**Post date:** [January 11, 2017, 9:04pm UTC](https://discourse.slimframework.com/t/get-settings-vs-use-settings/1022/2 "2017-01-11T21:04:14Z")

</div>

The second method will only work if the `$settings` variable is in scope.

Unless you have a reason not to use the settings stored in the container, I would go for the first option: retrieve the settings from the container.

---

<div class="post-metadata">

**Author:** ![SVL](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@SVL](https://discourse.slimframework.com/u/SVL)\
**Post date:** [January 14, 2017, 9:08am UTC](https://discourse.slimframework.com/t/get-settings-vs-use-settings/1022/3 "2017-01-14T09:08:54Z")

</div>

Thank you for the explanation.
