@@ -25,7 +25,7 @@ class ResourceStore
2525 // [type][priority][uri] = options
2626 protected $ _store = [];
2727
28- public function generateHtmlIncludes ($ for = self ::TYPE_CSS )
28+ public function generateHtmlIncludes ($ for = self ::TYPE_CSS , int $ priority = null , array $ excludePriority = [] )
2929 {
3030 if (!isset ($ this ->_store [$ for ]) || empty ($ this ->_store [$ for ]))
3131 {
@@ -43,7 +43,7 @@ public function generateHtmlIncludes($for = self::TYPE_CSS)
4343 }
4444 $ return = '' ;
4545
46- foreach ($ this ->getResources ($ for ) as $ uri => $ options )
46+ foreach ($ this ->getResources ($ for, $ priority , $ excludePriority ) as $ uri => $ options )
4747 {
4848 if (strlen ($ uri ) == 32 && !stristr ($ uri , '/ ' ))
4949 {
@@ -81,7 +81,7 @@ public function generateHtmlIncludes($for = self::TYPE_CSS)
8181 return $ return ;
8282 }
8383
84- public function getResources ($ type , int $ priority = null )
84+ public function getResources ($ type , int $ priority = null , array $ excludePriority = [] )
8585 {
8686 if (isset ($ this ->_store [$ type ][$ priority ]))
8787 {
@@ -93,11 +93,14 @@ public function getResources($type, int $priority = null)
9393 $ return = [];
9494 //Sort based on store priority
9595 ksort ($ this ->_store [$ type ]);
96- foreach ($ this ->_store [$ type ] as $ resources )
96+ foreach ($ this ->_store [$ type ] as $ currentPriority => $ resources )
9797 {
98- foreach ( $ resources as $ uri => $ options )
98+ if (! in_array ( $ currentPriority , $ excludePriority ) )
9999 {
100- $ return [$ uri ] = $ options ;
100+ foreach ($ resources as $ uri => $ options )
101+ {
102+ $ return [$ uri ] = $ options ;
103+ }
101104 }
102105 }
103106 return $ return ;
0 commit comments