Skip to content

Commit

Permalink
Merge pull request #11 from maxime-rainville/master
Browse files Browse the repository at this point in the history
Update SimpleStyleguideController to use dynamic asset url resolution
  • Loading branch information
benmanu authored Feb 14, 2020
2 parents 5eee71c + 0cb4cb6 commit cd10ffe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SimpleStyleguideController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\Core\Manifest\ModuleResourceLoader;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Security\Permission;
use SilverStripe\CMS\Model\SiteTree;
Expand Down Expand Up @@ -41,7 +42,7 @@ class SimpleStyleguideController extends Controller
* @config
* @var string
*/
private static $placeholder_image_url = '/resources/vendor/benmanu/silverstripe-simple-styleguide/images/placeholder.png';
private static $placeholder_image_url = 'benmanu/silverstripe-simple-styleguide: images/placeholder.png';

/**
* @var array
Expand Down Expand Up @@ -204,6 +205,7 @@ public function getColorSwatches()
public function getPlaceholderImageURL()
{
$url = $this->config()->placeholder_image_url;
$url = ModuleResourceLoader::singleton()->resolveURL($url);

$this->extend('updatePlaceholderImageURL', $url);

Expand Down

0 comments on commit cd10ffe

Please sign in to comment.