src/Charcoal/Admin/Ui/NestedWidgetContainerTrait.php
public function widgetData($key = null, $default = null)
    {
        if ($this->widgetData === null) {
            $this->widgetData = $this->defaultWidgetData();
        }

        if ($key) {
            if (isset($this->widgetData[$key])) {
                return $this->widgetData[$key];
            } else {
                if (!is_string($default) && is_callable($default)) {
                    return $default();
                } else {
                    return $default;
                }
            }
        }

        return $this->widgetData;
    }
public function widgetData($key = null, $default = null)
    {
        if ($this->widgetData === null) {
            $this->widgetData = $this->defaultWidgetData();
        }

        if ($key) {
            if (isset($this->widgetData[$key])) {
                return $this->widgetData[$key];
            } else {
                if (!is_string($default) && is_callable($default)) {
                    return $default();
                } else {
                    return $default;
                }
            }
        }

        return $this->widgetData;
    }
public function widgetData ( $ key = null , $ default = null ) { if ( $ this -> widgetData === null ) { $ this -> widgetData = $ this -> defaultWidgetData ( ) ; } if ( $ key ) { if ( isset ( $ this -> widgetData [ $ key ] ) ) { return $ this -> widgetData [ $ key ] ; } else { if ( ! is_string ( $ default ) && is_callable ( $ default ) ) { return $ default ( ) ; } else { return $ default ; } } } return $ this -> widgetData ; }
Retrieve the nested widget's options or a single option.

@param  string|null $key     The option key to lookup.
@param  mixed|null  $default The fallback value to return if the $key doesn't exist.
@return mixed
Retrieve the nested widget s options or a single option .