Gets an option or its default value if it is not set.

@param Container $app
@param string $name

@return mixed
12388
protected function getOption(Container $app, $name)
    {
        if (isset($app['silex_user.options'][$name])) {
            return $app['silex_user.options'][$name];
        } else {
            return self::$defaultOptions[$name];
        }
    }
549722
public function getValue($name)
    {
        return (isset($this->options['params'][$name])) ? $this->options['params'][$name] : null;
    }
916234
public function getOption($name)
    {
        if (!$this->hasOption($name)) {
            return null;
        }

        $getter = 'get' . ucfirst($name);

        return $this->options->{$getter}();
    }
795354
protected static function getOption($name, $default = null)
    {
        return isset(self::$options[$name]) ? self::$options[$name] : $default;
    }
973871
public function getOption($name){
        return (isset($this->configOptions->{$name})) ? $this->configOptions->{$name} : false;    
    }
1320588
public function getOpt(string $name, $default = null)
    {
        // is long-opt
        if (isset($name{1})) {
            return $this->lOpt($name, $default);
        }

        return $this->sOpt($name, $default);
    }
789165
public function getOption($name = null, $option = null)
    {
        if (is_null($name)) {
            return $this->_option;
        } else {
            $option || $option = $this->getOption();
            if (strpos($name, '.') !== false) {
                list ($key, $name) = explode('.', $name, 2);
                return isset($option[$key]) && is_array($option[$key]) ? $this->getOption($name, $option[$key]) : null;
            } else {
                return isset($option[$name]) ? $option[$name] : null;
            }
        }
    }
67858
public function getOption($name) {
		$this->validateName($name);
		if (array_key_exists($name, $this->config))
			return $this->config[$name];
	
		return null;
	}
706875
public static function get(string $name, ...$params) {
        if (AppContainer::isAutoLoad()) return self::getAutoLoad($name, $params);

        $map = self::getInstance();
        if (!$map->containsKey($name)) {
            return null;
        }
        /** @var Node $node */
        $node = $map->getNodeByKey($name);
        if (null === $node) {
            return null;
        }
        return $node->getValue()($params);
    }
29817
protected function getIlluminateConfig(Container $app)
    {
        $files = array();

        foreach (Finder::create()->files()->name('*.php')->in($app['path.config']) as $file) {
            $files[basename($file->getRealPath(), '.php')] = $file->getRealPath();
        }

        return $files;
    }
219009
protected function getOption($name, $default = null)
    {
        $matchedOption = null;
        foreach ($this->actions[$this->actionName]->getOptions() as $option) {
            if ($option->matchParam($name)) {
                $matchedOption = $option;
            }
        }
        $value = $matchedOption->getValue($this->args, $default);

        return $value;
    }
1132960
public static function get(string $key, $defaultValue = null, ?string $app = null)
    {
        return self::repository($app)->get($key, $defaultValue);
    }
1210993
public function getOption($Name)
    {
        if (!isset($this->options[$Name])) {
            throw $this->newException('Unknown option: ' . $Name);
        }
        return $this->options[$Name];
    }
1008892
public function getOption($name, $default = null)
    {
        $config = $this->getConfig();

        return array_key_exists($name, $config) ? $config[$name] : $default;
    }
159385
protected function option($name, $defaultValue = null)
    {
        $value = $this->getInput()->getOption($name);

        if (null === $value) {
            return $defaultValue;
        }

        return $value;
    }
273918
private function findDefaultImage(Application $app, $name)
    {
        $matcher = new Matcher($app['filesystem'], ['web', 'bolt_assets', 'themes', 'files']);

        $configKey = "thumbnails/{$name}_image";
        $path = $app['config']->get("general/$configKey");

        // Trim "view/" from front of path for BC.
        if (strpos($path, 'view/') === 0) {
            Deprecated::warn(
                'Not specifying a mount point for thumbnail paths',
                3.3,
                'Take a look at the config.yml.dist for how to update them.'
            );
            $path = substr($path, 5);
        }

        try {
            $image = $matcher->getImage($path);
        } catch (FileNotFoundException $e) {
            throw new DefaultImageNotFoundException(
                sprintf(
                    'Unable to locate %s image for thumbnails. Looked for: "%s". Please update "%s" in config.yml.',
                    $name,
                    $path,
                    $configKey
                ),
                $path,
                $e
            );
        }

        return $image;
    }
279480
public function getCheckbox($name, array $options=[]) {
		$choices = $this->getChoices();
		$default = $this->value;

		$value = isset($options['value']) ? $options['value']:null;
		if($value===null) {
			foreach($choices as $k=>$v) {
				if($v == $name) {
					$value = $k;
					break;
				}
			}
		}
		if($value === null)
			throw new \Exception('No value for checkbox '.$name);

		if(in_array($value, $default))
			$options['attrs']['checked'] = 'checked';
		$options['label'] = $name;

		return $this->getTopForm()->getWidget('checkbox', $this->name.'[]', $value, $options);
	}