File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
src/Tempest/View/src/Elements Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -34,21 +34,16 @@ public function getAttributes(): array
3434
3535 $ attributes = [...$ this ->attributes , ...$ wrappingAttributes ];
3636
37- // Some attributes should always come after others,
38- // so that these expressions have access to the data attributes
39- $ attributePrecedence = [
40- ':foreach ' => 1 ,
41- ':if ' => 2 ,
42- ];
37+ $ tailingAttributes = [];
4338
44- uksort ($ attributes, function ( string $ a , string $ b ) use ( $ attributePrecedence ) {
45- $ precedenceA = $ attributePrecedence [ $ a ] ?? 0 ;
46- $ precedenceB = $ attributePrecedence [ $ b ] ?? 0 ;
47-
48- return $ precedenceA <=> $ precedenceB ;
49- });
39+ foreach ($ attributes as $ name => $ value ) {
40+ if ( $ name === ' :foreach ' || $ name === ' :if ' ) {
41+ unset( $ attributes [ $ name ]) ;
42+ $ tailingAttributes [ $ name ] = $ value ;
43+ }
44+ }
5045
51- return $ attributes ;
46+ return [... $ attributes, ... $ tailingAttributes ] ;
5247 }
5348
5449 public function hasAttribute (string $ name ): bool
You can’t perform that action at this time.
0 commit comments