diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/View.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Minz/View.php b/lib/Minz/View.php index 6cf811bff..8faeb9078 100644 --- a/lib/Minz/View.php +++ b/lib/Minz/View.php @@ -248,6 +248,9 @@ class Minz_View { } $scripts .= '<script src="' . $script['url'] . '"'; + if (!empty($script['id'])) { + $scripts .= ' id="' . $script['id'] . '"'; + } if ($script['defer']) { $scripts .= ' defer="defer"'; } @@ -265,20 +268,22 @@ class Minz_View { return $scripts; } - public static function prependScript ($url, $cond = false, $defer = true, $async = true) { + public static function prependScript ($url, $cond = false, $defer = true, $async = true, $id = '') { array_unshift(self::$scripts, array ( 'url' => $url, 'cond' => $cond, 'defer' => $defer, 'async' => $async, + 'id' => $id, )); } - public static function appendScript ($url, $cond = false, $defer = true, $async = true) { + public static function appendScript ($url, $cond = false, $defer = true, $async = true, $id = '') { self::$scripts[] = array ( 'url' => $url, 'cond' => $cond, 'defer' => $defer, 'async' => $async, + 'id' => $id, ); } |
