Craft\AmNavService::getNavRaw PHP Method

getNavRaw() public method

Get a navigation structure without any HTML.
public getNavRaw ( string $handle, array $params, string $locale = null ) : array
$handle string
$params array
$locale string
return array
    public function getNavRaw($handle, $params, $locale = null)
    {
        $navigation = $this->getNavigationByHandle($handle);
        // Check for a missing nav and report the error appropriately
        if (!$navigation) {
            $e = new Exception(Craft::t('No navigation exists with the handle “{handle}”.', array('handle' => $handle)));
            if ($this->_isQuietErrorsEnabled()) {
                Craft::log('Error::', $e->getMessage(), LogLevel::Warning);
                return $navigation;
            } else {
                throw $e;
            }
        }
        $this->_navigation = $navigation;
        // We want correct URLs now
        $this->_parseEnvironment = true;
        // Get the params
        $this->_setParams($params);
        // We don't want HTML returned
        $this->_parseHtml = false;
        // Return the array structure
        return $this->getNodesByNavigationId($navigation->id, $locale);
    }