From 18a4ade32f01fe615674efc864eb01ca826ce65e Mon Sep 17 00:00:00 2001 From: maTh Date: Tue, 22 Nov 2022 08:18:52 +0100 Subject: Improved: Minz Framework. Byebye Internet Explorer and its Conditional comments (#4651) * Update View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php Co-authored-by: Frans de Jonge * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php * Update lib/Minz/View.php Co-authored-by: Alexandre Alapetite Co-authored-by: Frans de Jonge --- lib/Minz/View.php | 60 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/lib/Minz/View.php b/lib/Minz/View.php index 8faeb9078..459ef1e23 100644 --- a/lib/Minz/View.php +++ b/lib/Minz/View.php @@ -202,36 +202,38 @@ class Minz_View { $styles = ''; foreach(self::$styles as $style) { - $cond = $style['cond']; - if ($cond) { - $styles .= ''; - } - $styles .= "\n"; } return $styles; } - public static function prependStyle ($url, $media = 'all', $cond = false) { + /** + * Prepends a element referencing stylesheet. + * + * @param string $url + * @param string $media + * @param bool $cond Conditional comment for IE, now deprecated and ignored + */ + public static function prependStyle($url, $media = 'all', $cond = false) { array_unshift (self::$styles, array ( 'url' => $url, 'media' => $media, - 'cond' => $cond )); } - public static function appendStyle ($url, $media = 'all', $cond = false) { + /** + * Append a `` element referencing stylesheet. + * @param string $url + * @param string $media + * @param bool $cond Conditional comment for IE, now deprecated and ignored + */ + public static function appendStyle($url, $media = 'all', $cond = false) { self::$styles[] = array ( 'url' => $url, 'media' => $media, - 'cond' => $cond ); } @@ -242,11 +244,6 @@ class Minz_View { $scripts = ''; foreach (self::$scripts as $script) { - $cond = $script['cond']; - if ($cond) { - $scripts .= ''; - } - $scripts .= "\n"; } return $scripts; } - public static function prependScript ($url, $cond = false, $defer = true, $async = true, $id = '') { + /** + * Prepend a `