I have the following scenario: Extension A and extension B have routes
/a
and /b
, respectively. They each display some sweet content using their template files /ext/kasimi/a/styles/prosilver/template/a_content.html
and /ext/kasimi/b/styles/prosilver/template/b_content.html
.Now imagine an extension C that wants to display the information from A's page on other pages of the board. This is how I tried to solve it: C hooks into an event that is triggered on every page where A's content should be display.
Code: Select all
// Event handler in extension C
public function event_handler()
{
// Assign content of A's page to the template
$this->ext_a_controller->assign_a_content();
}
Code: Select all
<!-- INCLUDE a_content.html --> displayed by C
a_content.html
can't be found. I fixed this by adding the following code to C's event_handler()
above:Code: Select all
$this->template->set_style(array(
'ext/kasimi/c/styles', // so that the template event in C is found
'ext/kasimi/a/styles', // so that it can render a_content.html
'styles', // phpBB's core template files
));
a_content.html
is displayed on every page where the event is triggered that C subscribed to.Here's the problem: it doesn't work on B's page at
/b
- and on any other page where an extension renders something for that matter. It can't find B's b_content.html
because the call to set_style()
overwrites the paths where the template engine looks for template files.So, is there a way to add style paths and not overwrite existing ones?