From cab1ea0dbe4ed17425aaa4debd715450d934c203 Mon Sep 17 00:00:00 2001 From: Christopher Darling Date: Tue, 5 Jun 2018 16:58:37 +0100 Subject: [PATCH] DOCS fix 4.0.0 changelog example code ThemeResourceLoader::inst()->findThemedResource() requires two arguments https://github.com/silverstripe/silverstripe-framework/blob/af2c3886b90bcb2c2964633c9dcc33c91d960140/src/View/ThemeResourceLoader.php#L286-L294 --- docs/en/04_Changelogs/4.0.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 8f9dd9a66..70a5ade14 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -484,6 +484,7 @@ Usage with custom logic: ```diff +use SilverStripe\Core\Manifest\ModuleLoader; +use SilverStripe\View\ThemeResourceLoader; ++use SilverStripe\View\SSViewer; -$moduleFilePath = FRAMEWORK_DIR . '/MyFile.php'; +$moduleFilePath = ModuleLoader::getModule('silverstripe/framework')->getResource('MyFile.php')->getRelativePath(); @@ -495,7 +496,8 @@ Usage with custom logic: +$mysiteFilePath = ModuleLoader::getModule('mysite')->getResource('css/styles.css')->getRelativePath(); -$themesFilePath = SSViewer::get_theme_folder() . '/css/styles.css'; -+$themesFilePath = ThemeResourceLoader::inst()->findThemedResource('css/styles.css'); ++$themes = SSViewer::get_themes(); ++$themesFilePath = ThemeResourceLoader::inst()->findThemedResource('css/styles.css', $themes); -$themeFolderPath = THEMES_DIR . '/simple'; +$themeFolderPath = ThemeResourceLoader::inst()->getPath('simple');