Skip to content
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 #265

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli force-pushed the pulls/6/refactor-template-layer branch from 3b46bb9 to 94bd9e0 Compare October 14, 2024 03:01
@GuySartorelli GuySartorelli marked this pull request as ready for review October 23, 2024 03:02
Comment on lines -168 to +171
$template = SSViewer::fromString($config->ReviewBody);
$value = $template->process(ArrayData::create($variables));

$engine = Injector::inst()->create(TemplateEngine::class);
$value = $engine->renderString($config->ReviewBody, ViewLayerData::create(ArrayData::create($variables)));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use TemplateEngine instead of explicitly SSTemplateEngine because ReviewBody could be updated to contain whatever syntax the devs wanna use.

@emteknetnz emteknetnz merged commit 1bce10d into silverstripe:6 Oct 30, 2024
9 of 11 checks passed
@emteknetnz emteknetnz deleted the pulls/6/refactor-template-layer branch October 30, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants