File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Cmfcmf/OpenWeatherMap/Util Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class Weather
42
42
*
43
43
* @see self::getIconUrl() to see how it is used.
44
44
*/
45
- private $ iconUrl = "http: //openweathermap.org/img/w/%s.png " ;
45
+ private static $ iconUrl = "//openweathermap.org/img/w/%s.png " ;
46
46
47
47
/**
48
48
* Create a new weather object.
@@ -77,6 +77,17 @@ public function __toString()
77
77
*/
78
78
public function getIconUrl ()
79
79
{
80
- return str_replace ("%s " , $ this ->icon , $ this ->iconUrl );
80
+ return str_replace ("%s " , $ this ->icon , self ::$ iconUrl );
81
+ }
82
+
83
+ /**
84
+ * Change the url template for icon urls. Please note: This will change the url template for
85
+ * all instances of this library.
86
+ *
87
+ * @param string $iconUrl The url template to build the icon urls.
88
+ */
89
+ public static function setIconUrlTemplate ($ iconUrl )
90
+ {
91
+ self ::$ iconUrl = $ iconUrl ;
81
92
}
82
93
}
You can’t perform that action at this time.
0 commit comments