$template1 = getMyTemplateStyleWithParameters();
JFactory::getApplication()->setTemplate($template1);
$template2 = JFactory::getApplication()->getTemplate(true);
Expect getTemplate() to return what I passed into setTemplate().
setTemplate() raises PHP error - needs to be passed a string not an object.
getTemplate() returns the default template for the current page.
Joomla 3.9.19
I expect setTemplate() to behave something like this ...
public function setTemplate($template, $styleParams = null)
{
if (is_object($template))
{
$this->template->template = $template;
}
else if (is_dir(JPATH_THEMES . '/' . $template))
{
$this->template = new \stdClass;
$this->template->template = $template;
if ($styleParams instanceof Registry)
{
$this->template->params = $styleParams;
}
else
{
$this->template->params = new Registry($styleParams);
}
}
// Store the template and its params to the config
$this->set('theme', $this->template->template);
$this->set('themeParams', $this->template->params);
}
Labels |
Added:
J3 Issue
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-07-28 11:22:51 |
Closed_By | ⇒ | BrainforgeUK |