From 71e4b6820055d0454c3763d784ac5c5f4756484a Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Mon, 11 Mar 2019 18:38:17 +0300 Subject: [PATCH] Fix assets urls on non *nix systems --- Plugin.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Plugin.php b/Plugin.php index 55ff25b..ccef369 100644 --- a/Plugin.php +++ b/Plugin.php @@ -102,9 +102,10 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi public function pageAddJsHandler(&$args) { if ($args['request']->attributes->get('_route') == 'users') { - $args['js'][] = $this->getFilesPath() . '/vendor/jquery-colorbox/jquery.colorbox-min.js'; - $args['js'][] = $this->getFilesPath() . '/vendor/leaflet/dist/leaflet.js'; - $args['js'][] = $this->getFilesPath() . '/js/plugin.js'; + $filepath = str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath()); + $args['js'][] = $filepath . '/vendor/jquery-colorbox/jquery.colorbox-min.js'; + $args['js'][] = $filepath . '/vendor/leaflet/dist/leaflet.js'; + $args['js'][] = $filepath . '/js/plugin.js'; } } @@ -116,9 +117,10 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi public function pageAddCssHandler(&$args) { if ($args['request']->attributes->get('_route') == 'users') { - $args['css'][] = $this->getFilesPath() . '/vendor/jquery-colorbox/example3/colorbox.css'; - $args['css'][] = $this->getFilesPath() . '/vendor/leaflet/dist/leaflet.css'; - $args['css'][] = $this->getFilesPath() . '/css/styles.css'; + $filepath = str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath()); + $args['css'][] = $filepath . '/vendor/jquery-colorbox/example3/colorbox.css'; + $args['css'][] = $filepath . '/vendor/leaflet/dist/leaflet.css'; + $args['css'][] = $filepath . '/css/styles.css'; } }