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
4242 *
4343 * @see self::getIconUrl() to see how it is used.
4444 */
45- private $ iconUrl = "http: //openweathermap.org/img/w/%s.png " ;
45+ private static $ iconUrl = "//openweathermap.org/img/w/%s.png " ;
4646
4747 /**
4848 * Create a new weather object.
@@ -77,6 +77,17 @@ public function __toString()
7777 */
7878 public function getIconUrl ()
7979 {
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 ;
8192 }
8293}
You can’t perform that action at this time.
0 commit comments