Skip to content

Commit 13122e2

Browse files
committed
Custom action support
1 parent 2f79098 commit 13122e2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Turbo/src/Helper/TurboStream.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public static function custom(string $action, string $target, string $html, arra
9696
return self::wrap($action, $target, $html, $attr);
9797
}
9898

99+
/**
100+
* @param array<string> $attr
101+
*/
99102
private static function wrap(string $action, string $target, string $html, array $attr = []): string
100103
{
101104
// Join array elements with a space and prepend a leading space

src/Turbo/tests/Helper/TurboStreamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testRefreshWithId(): void
8080
public function testCustom(): void
8181
{
8282
$this->assertSame(<<<EOHTML
83-
<turbo-stream action="customAction" someAttr="someValue" boolAttr>
83+
<turbo-stream action="customAction" targets="some[&quot;selector&quot;]" someAttr="someValue" boolAttr>
8484
<template><div>content</div></template>
8585
</turbo-stream>
8686
EOHTML,

0 commit comments

Comments
 (0)