-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LiveComponent] Add docblocks on attributes
- Loading branch information
Showing
7 changed files
with
121 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,26 @@ | |
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent; | ||
|
||
/** | ||
* An attribute to register a LiveComponent. | ||
* | ||
* @see https://symfony.com/bundles/ux-live-component | ||
* | ||
* @author Kevin Bond <[email protected]> | ||
* | ||
* @experimental | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_CLASS)] | ||
final class AsLiveComponent extends AsTwigComponent | ||
{ | ||
/** | ||
* @param string|null $name The component name (ie: TodoList) | ||
* @param string|null $template The template path of the component (ie: components/TodoList.html.twig). | ||
* @param string|null $defaultAction The default action to call when the component is mounted (ie: __invoke) | ||
* @param bool $exposePublicProps Whether to expose every public property as a Twig variable | ||
* @param string $attributesVar The name of the special "attributes" variable in the template | ||
* @param bool $csrf Whether to enable CSRF protection (default: true) | ||
* @param string $route The route used to render the component & handle actions (default: ux_live_component) | ||
*/ | ||
public function __construct( | ||
string $name = null, | ||
string $template = null, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,23 @@ | |
namespace Symfony\UX\LiveComponent\Attribute; | ||
|
||
/** | ||
* An attribute to configure a LiveArg (custom argument passed to a LiveAction). | ||
* | ||
* @see https://symfony.com/bundles/ux-live-component/current/index.html#actions-arguments | ||
* | ||
* @author Tomas Norkūnas <[email protected]> | ||
* | ||
* @experimental | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_PARAMETER)] | ||
final class LiveArg | ||
{ | ||
public function __construct(public ?string $name = null) | ||
{ | ||
public function __construct( | ||
/** | ||
* @param string|null $name The name of the argument received by the LiveAction | ||
*/ | ||
public ?string $name = null, | ||
) { | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters