Back to HTMLRegistryAwareTrait class

Method getRegistry

public \Joomla\CMS\HTML\Registry
getRegistry
()
Get the registry.
Returns
  • \Joomla\CMS\HTML\Registry
Since
  • 4.0.0
-
  • \UnexpectedValueException May be thrown if the registry has not been set.

Method getRegistry - Source code

/**
 * Get the registry.
 *
 * @return  Registry
 *
 * @since   4.0.0
 * @throws  \UnexpectedValueException May be thrown if the registry has not been set.
 */
public function getRegistry()
{
    if ($this->registry) {
        return $this->registry;
    }
    throw new \UnexpectedValueException('HTML registry not set in ' . __CLASS__);
}