Back to MenuItem class

Method getParams

public \Joomla\Registry\Registry
getParams
()
Returns the menu item parameters
Returns
  • \Joomla\Registry\Registry
Since
  • 3.7.0
Class: MenuItem
Project: Joomla

Method getParams - Source code

/**
 * Returns the menu item parameters
 *
 * @return  Registry
 *
 * @since   3.7.0
 */
public function getParams()
{
    if (!$this->params instanceof Registry) {
        try {
            $this->params = new Registry($this->params);
        } catch (\RuntimeException $e) {
            /*
             * Joomla shipped with a broken sample json string for 4 years which caused fatals with new
             * error checks. So for now we catch the exception here - but one day we should remove it and require
             * valid JSON.
             */
            $this->params = new Registry();
        }
    }
    return $this->params;
}