@param array  $options
@param string $name
@param bool   $default

@return bool
546458
public static function isEnabled(array $options, string $name, $default = false): bool
    {
        $enabled = $default;
        $options = self::normalize($options);

        if (array_key_exists('*', $options)) {
            $enabled = $options['*'];
        }

        if (array_key_exists($name, $options)) {
            $enabled = (bool) $options[$name];
        }

        return $enabled;
    }
823633
public static function getArray(
        array $options,
        string $key,
        $default = null
    ) {
        if (array_key_exists($key, $options)) {
            return (array)$options[$key];
        }

        return $default;
    }
1344233
public function group($Name, $Options = null)
    {
    
        if (!$Name) {
            throw $this->newException('You must specify a label for the group!');
        }
        
        if ($Options) {
            if (!is_array($Options)) {
                throw $this->newException('Options must be defined as an array!');
            }
            if (array_key_exists('Collapsed', $Options)) {
                $Options['Collapsed'] = ($Options['Collapsed'])?'true':'false';
            }
        }
        
        return $this->fb(null, $Name, FirePHP::GROUP_START, $Options);
    }
855239
public function bool($name, $default = null)
    {
        $cmnd = $name.' tinyint(1)';
        //
        if (!empty($default)) {
            $default = $default ? '1' : '0';
            $cmnd .= " DEFAULT $default ";
        }
        //
        self::$colmuns[] = $cmnd;
        //
        return $this;
    }
660028
protected function _getOption( $name, $default = null )
	{
		return ( isset( $this->_options[$name] ) ? $this->_options[$name] : $default );
	}
993291
public function createCollection($name, $options = [])
    {
        try {
            if (isset($options['capped'])) {
                $options['capped'] = (bool) $options['capped'];
            }

            $this->db->createCollection($name, $options);
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            return false;
        }

        return $this->selectCollection($name);
    }
928398
public static function save($name, $option = array())
	{
		$obj = self::getInstance($name);
		if ($obj)
		{
			return $obj->save($option);
		}
		else
		{
			return false;
		}
	}
23554
public function input($name, $options = array())
    {
        $options += array(
            "type"  => "text",
            "id"    => $this->id($name),
            "name"  => $this->name($name),
            "error" => true,
            "class" => "",
            "value" => "",
            "label" => null
        );

        $currentValue = $this->getCurrentValue($options['name']);

        $errorHtml = "";
        $fieldHasErrors = false;

        if (!is_null($this->associatedEntity)) {
            // Checkboxes may be posted has data[name][0] and therefore
            // we need to remove it to get the absolute field name.
            $validationName = $options["type"] === "checkbox" ?
                preg_replace('/\[\d+\]$/', '', $name) :
                $name;

            if ($this->associatedEntity->hasErrors($validationName)) {
                if ((bool)$options['error']) {
                    $errorHtml = $this->generateInlineErrors($validationName);
                }
                $fieldHasErrors = true;
                $options['class'] .= " error ";
            }
        }
        unset($options["error"]);

        $label = "";
        if (!is_null($options['label'])) {
            $labelOptions = array(
                "for"    => $options["id"],
                "class" => $fieldHasErrors ? "error" : "",
                "label" => $options["label"],
            );

            $label .= $this->label($options['name'], $labelOptions);
        }
        unset($options['label']);

        switch (strtolower($options['type'])) {
            case "textarea":
                return $label . "\n" . $this->generateTextarea($options, $currentValue) . $errorHtml . "\n";
            case "select":
                return $label . "\n" . $this->generateSelect($options, $currentValue) . $errorHtml . "\n";
            case "radio":
                return $this->generateRadio($options, $currentValue) . $errorHtml . "\n" . $label . "\n";
            case "checkbox":
                return $this->generateCheckbox($options, $currentValue) . $errorHtml . "\n" . $label . "\n";
            case "hidden":
                return $label . "\n" . $this->generateHidden($options, $currentValue) . $errorHtml . "\n";
            default:
                return $label . "\n" . $this->generateTextinput($options, $currentValue) . $errorHtml . "\n";
        }
    }
1292609
public function getOption($name, $default = null)
    {
        return array_key_exists($name, $this->_options) ?
            $this->_options[$name] :
            $default;
    }
567839
public static function bcfg($name, $default = false) {
        if ($name == null) {
            return false;
        } else {
            $val = App::cfg($name, $default);
            if (is_bool($val)) {
                return $val;
            }
            if (empty ($val) || $val == 'false' || $val == '0') {
                return false;
            }

            return true;
        }
    }
1003668
private function initialise_option($name, $default) {
        $param = optional_param($name, null, PARAM_BOOL);
        if (is_null($param)) {
            return get_user_preferences($name, $default);
        } else {
            set_user_preference($name, $param);
            return $param;
        }
    }
850933
public function file($name, array $options = [])
    {
        return $this->form->file($name, $this->addFormControlClass($this->getFieldOptions($name, $options)));
    }
948670
public function param($name, $default = null)
    {
        if(!$this->params)
            $this->params = $this->getMethod() == 'GET' ? $this->getQueryParams() : array_merge($this->getQueryParams(), $this->getParsedBody());

        return array_key_exists($name, $this->params) ? $this->params[$name] : $default;
    }
1265315
protected function bool(string $name, $default = null): Closure
    {
        return function (Table $table) use ($name, $default) {
            $column = $table->addColumn($name, Type::BOOLEAN)->setNotnull(true);
            if ($default !== null && is_bool($default) === true) {
                $column->setDefault($default);
            }
        };
    }
1306386
public function make($name, array $options)
    {
        //check the permission on this item
        $options = $this->parseDefaults($name, $options);

        //now we can instantiate the object
        return $this->getActionObject($options);
    }
1008892
public function getOption($name, $default = null)
    {
        $config = $this->getConfig();

        return array_key_exists($name, $config) ? $config[$name] : $default;
    }
1281358
public static function addScript(string $name, array $options = [])
    {
        if (! in_array($name, self::getScripts()))
            self::$scripts[] = $name;
        self::setOptions($name, $options);
    }