Back to ApiApplication class

Method getTemplate

public string|\stdClass
getTemplate
(mixed $params = false)
Gets the name of the current template.
Parameters
  • bool $params True to return the template parameters
Returns
  • string|\stdClass
Since
  • 4.0.0

Method getTemplate - Source code

/**
 * Gets the name of the current template.
 *
 * @param   boolean  $params  True to return the template parameters
 *
 * @return  string|\stdClass
 *
 * @since   4.0.0
 */
public function getTemplate($params = false)
{
    // The API application should not need to use a template
    if ($params) {
        $template = new \stdClass();
        $template->template = 'system';
        $template->params = new Registry();
        $template->inheritable = 0;
        $template->parent = '';
        return $template;
    }
    return 'system';
}