Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Using bower to get css and js files #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"source": "https://github.com/2amigos/yii2-leaflet-markercluster-plugin"
},
"require": {
"2amigos/yii2-leaflet-extension": "~1.0"
"2amigos/yii2-leaflet-extension": "~1.0",
"bower-asset/leaflet.markercluster": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "4.*"
Expand Down
8 changes: 4 additions & 4 deletions src/MarkerClusterAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class MarkerClusterAsset extends AssetBundle
{

public $css = [
'css/MarkerCluster.css',
'css/MarkerCluster.Default.css'
'MarkerCluster.css',
'MarkerCluster.Default.css'
];

public $depends = [
Expand All @@ -32,7 +32,7 @@ class MarkerClusterAsset extends AssetBundle

public function init()
{
$this->sourcePath = __DIR__ . '/assets';
$this->js = YII_DEBUG ? ['js/leaflet.markercluster-src.js'] : ['js/leaflet.markercluster.js'];
$this->sourcePath = \Yii::getAlias('@bower').'/leaflet.markercluster/dist';
$this->js = YII_DEBUG ? ['leaflet.markercluster-src.js'] : ['leaflet.markercluster.js'];
Copy link
Member

Choose a reason for hiding this comment

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

This was a huge mistake from my end. We should add the reference on public $js attribute. Do you mind make the change?

Thank you so much @vladim1

Copy link
Author

Choose a reason for hiding this comment

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

I don't mind to make the change, but I didn't get what is wrong with the current PR.

Copy link
Member

Choose a reason for hiding this comment

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

Nothing wrong, just asking for your help there

}
}