Skip to content

Commit

Permalink
Merge pull request #6 from klees/improvement/5-3/allow-plugin-ui-comp…
Browse files Browse the repository at this point in the history
…onents-to-be-rendered

UI: introduced getTemplatePath instead of making getTemplate overwriteable
  • Loading branch information
chfsx authored Nov 28, 2017
2 parents ea69307 + 66179b5 commit 7190085
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/UI/Implementation/Render/AbstractComponentRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,22 @@ final protected function getJavascriptBinding() {
* @throws \InvalidArgumentException if there is no such template
* @return \ILIAS\UI\Implementation\Render\Template
*/
protected function getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks) {
$component = $this->getMyComponent();
$path = "src/UI/templates/default/$component/$name";

final protected function getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks) {
$path = $this->getTemplatePath($name);
return $this->tpl_factory->getTemplate($path, $purge_unfilled_vars, $purge_unused_blocks);
}

/**
* Get the path to the template of this component.
*
* @param string $name
* @return string
*/
protected function getTemplatePath($name) {
$component = $this->getMyComponent();
return "src/UI/templates/default/$component/$name";
}

/**
* Bind the component to JavaScript.
*
Expand Down

0 comments on commit 7190085

Please sign in to comment.