DOCS fix 4.0.0 changelog example code

ThemeResourceLoader::inst()->findThemedResource() requires two arguments af2c3886b9/src/View/ThemeResourceLoader.php (L286-L294)
This commit is contained in:
Christopher Darling 2018-06-05 16:58:37 +01:00 committed by GitHub
parent 0bec6e07dc
commit cab1ea0dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');