Back to CMSApplication class

Method getCfg

public mixed
getCfg
(mixed $varname, mixed $default = null)
Gets a configuration value.
Parameters
  • string $varname The name of the value to get.
  • string $default Default value to return
Returns
  • mixed The user state.
Since
  • 3.2
Deprecated
  • 5.0

Method getCfg - Source code

/**
 * Gets a configuration value.
 *
 * @param   string  $varname  The name of the value to get.
 * @param   string  $default  Default value to return
 *
 * @return  mixed  The user state.
 *
 * @since   3.2
 * @deprecated  5.0  Use get() instead
 */
public function getCfg($varname, $default = null)
{
    try {
        Log::add(sprintf('%s() is deprecated and will be removed in 5.0. Use JFactory->getApplication()->get() instead.', __METHOD__), Log::WARNING, 'deprecated');
    } catch (\RuntimeException $exception) {
        // Informational log only
    }
    return $this->get($varname, $default);
}