public function getValue($key, $view)
    {
        if (is_scalar($view)) {
            return '';
        }

        if (strpos($key, '.')) {
            return $this->getDotValue($key, $view);
        }

        if (is_object($view)) {
            if (method_exists($view, $key)) {
                return call_user_func([$view, $key]);
            } elseif (isset($view->$key)) {
                return $view->$key;
            }
            return '';
        }
        if (isset($view[$key])) {
            if (is_callable($view[$key]) && $this->isValidCallback($view[$key])) {
                return call_user_func($view[$key]);
            }
            return $view[$key];
        }
        return '';
    }
public function getValue($key, $view)
    {
        if (is_scalar($view)) {
            return '';
        }

        if (strpos($key, '.')) {
            return $this->getDotValue($key, $view);
        }

        if (is_object($view)) {
            if (method_exists($view, $key)) {
                return call_user_func([$view, $key]);
            } elseif (isset($view->$key)) {
                return $view->$key;
            }
            return '';
        }
        if (isset($view[$key])) {
            if (is_callable($view[$key]) && $this->isValidCallback($view[$key])) {
                return call_user_func($view[$key]);
            }
            return $view[$key];
        }
        return '';
    }
public function getValue ( $ key , $ view ) { if ( is_scalar ( $ view ) ) { return '' ; } if ( strpos ( $ key , '.' ) ) { return $ this -> getDotValue ( $ key , $ view ) ; } if ( is_object ( $ view ) ) { if ( method_exists ( $ view , $ key ) ) { return call_user_func ( [ $ view , $ key ] ) ; } elseif ( isset ( $ view -> $ key ) ) { return $ view -> $ key ; } return '' ; } if ( isset ( $ view [ $ key ] ) ) { if ( is_callable ( $ view [ $ key ] ) && $ this -> isValidCallback ( $ view [ $ key ] ) ) { return call_user_func ( $ view [ $ key ] ) ; } return $ view [ $ key ] ; } return '' ; }
Get a named value from the view

Returns an empty string if no matching value found.

@param  string $key
@param  mixed $view
@return mixed
Get a named value from the view