-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Update code to reflect changes in template layer #1833
ENH Update code to reflect changes in template layer #1833
Conversation
e70be94
to
ab8be54
Compare
ab8be54
to
f43851a
Compare
$renderWith = SSViewer::chooseTemplate($templates); | ||
return $navigator->renderWith($renderWith); | ||
return $navigator->renderWith($templates); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives the exact same result. There was no need for the chooseTemplate()
there inbetween (which is good 'cause we can't do that anymore)
* Return appropriate template(s) for this class, with the given suffix using | ||
* Return appropriate template candidates for this class, with the given suffix using | ||
* {@link SSViewer::get_templates_by_class()} | ||
* | ||
* @param string $suffix | ||
* @return string|array | ||
*/ | ||
public function getTemplatesWithSuffix($suffix) | ||
public function getTemplatesWithSuffix(string $suffix): array | ||
{ | ||
$templates = SSViewer::get_templates_by_class(get_class($this), $suffix, __CLASS__); | ||
return SSViewer::chooseTemplate($templates); | ||
return SSViewer::get_templates_by_class(get_class($this), $suffix, __CLASS__); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to give specific absolute file paths to templates.
We can't do that anymore, because a) some template engines might not support that, and b) we don't want to pass a .ss template path to a twig template engine for example.
Thankfully, everywhere that used this doesn't actually need full absolute file paths. They just need some template candidates, and the ability to ask the configured engine if it can find files from those candidates or not.
Relies and reflects on changes in silverstripe/silverstripe-framework#11405
Issue