@@ -21,30 +21,44 @@ public function topStart(string|array|null $options, int $order = 0): static
21
21
return $ this ->top ($ options , $ order , 'Start ' );
22
22
}
23
23
24
+ public function top (array |string |null $ options , ?int $ order = null , ?string $ position = null ): static
25
+ {
26
+ if ($ order > 0 ) {
27
+ $ this ->attributes ["top {$ order }{$ position }" ] = $ options ;
28
+ } else {
29
+ $ this ->attributes ["top {$ position }" ] = $ options ;
30
+ }
31
+
32
+ return $ this ;
33
+ }
34
+
24
35
public function topEnd (string |array |null $ options , int $ order = 0 ): static
25
36
{
26
37
return $ this ->top ($ options , $ order , 'End ' );
27
38
}
28
39
29
- public function bottomStart (string | array | null $ options , int $ order = 0 ): static
40
+ public function topEndView (string $ selector , int $ order = 0 ): static
30
41
{
31
- return $ this ->bottom ( $ options , $ order , 'Start ' );
42
+ return $ this ->topView ( $ selector , $ order , 'End ' );
32
43
}
33
44
34
- public function bottomEnd (string | array | null $ options , int $ order = 0 ): static
45
+ public function topView (string $ selector , int $ order = 0 , ? string $ position = null ): static
35
46
{
36
- return $ this ->bottom ($ options , $ order , 'End ' );
47
+ $ script = "function() { return $(' {$ selector }').html(); } " ;
48
+
49
+ return $ this ->top ($ script , $ order , $ position );
37
50
}
38
51
39
- public function top ( array | string | null $ options , ? int $ order = null , ? string $ position = null ): static
52
+ public function bottomStartView ( string $ selector , int $ order = 0 ): static
40
53
{
41
- if ($ order > 0 ) {
42
- $ this ->attributes ["top {$ order }{$ position }" ] = $ options ;
43
- } else {
44
- $ this ->attributes ["top {$ position }" ] = $ options ;
45
- }
54
+ return $ this ->bottomView ($ selector , $ order , 'Start ' );
55
+ }
46
56
47
- return $ this ;
57
+ public function bottomView (string $ selector , int $ order = 0 , ?string $ position = null ): static
58
+ {
59
+ $ script = "function() { return $(' {$ selector }').html(); } " ;
60
+
61
+ return $ this ->bottom ($ script , $ order , $ position );
48
62
}
49
63
50
64
public function bottom (array |string |null $ options , ?int $ order = null , ?string $ position = null ): static
@@ -57,4 +71,24 @@ public function bottom(array|string|null $options, ?int $order = null, ?string $
57
71
58
72
return $ this ;
59
73
}
74
+
75
+ public function bottomEndView (string $ selector , int $ order = 0 ): static
76
+ {
77
+ return $ this ->bottomView ($ selector , $ order , 'End ' );
78
+ }
79
+
80
+ public function topStartView (string $ selector , int $ order = 0 ): static
81
+ {
82
+ return $ this ->topView ($ selector , $ order , 'Start ' );
83
+ }
84
+
85
+ public function bottomStart (string |array |null $ options , int $ order = 0 ): static
86
+ {
87
+ return $ this ->bottom ($ options , $ order , 'Start ' );
88
+ }
89
+
90
+ public function bottomEnd (string |array |null $ options , int $ order = 0 ): static
91
+ {
92
+ return $ this ->bottom ($ options , $ order , 'End ' );
93
+ }
60
94
}
0 commit comments