@@ -19,6 +19,7 @@ final class AssociationField implements FieldInterface
1919 public const OPTION_EMBEDDED_CRUD_FORM_CONTROLLER = 'crudControllerFqcn ' ;
2020 public const OPTION_WIDGET = 'widget ' ;
2121 public const OPTION_QUERY_BUILDER_CALLABLE = 'queryBuilderCallable ' ;
22+ public const OPTION_URL = 'url ' ;
2223 /** @internal this option is intended for internal use only */
2324 public const OPTION_RELATED_URL = 'relatedUrl ' ;
2425 /** @internal this option is intended for internal use only */
@@ -55,6 +56,7 @@ public static function new(string $propertyName, TranslatableInterface|string|bo
5556 ->setCustomOption (self ::OPTION_EMBEDDED_CRUD_FORM_CONTROLLER , null )
5657 ->setCustomOption (self ::OPTION_WIDGET , self ::WIDGET_AUTOCOMPLETE )
5758 ->setCustomOption (self ::OPTION_QUERY_BUILDER_CALLABLE , null )
59+ ->setCustomOption (self ::OPTION_URL , null )
5860 ->setCustomOption (self ::OPTION_RELATED_URL , null )
5961 ->setCustomOption (self ::OPTION_DOCTRINE_ASSOCIATION_TYPE , null )
6062 ->setCustomOption (self ::OPTION_RENDER_AS_EMBEDDED_FORM , false )
@@ -107,6 +109,13 @@ public function setQueryBuilder(\Closure $queryBuilderCallable): self
107109 return $ this ;
108110 }
109111
112+ public function linkToUrl (string |callable $ url ): self
113+ {
114+ $ this ->setCustomOption (self ::OPTION_URL , $ url );
115+
116+ return $ this ;
117+ }
118+
110119 public function renderAsEmbeddedForm (?string $ crudControllerFqcn = null , ?string $ crudNewPageName = null , ?string $ crudEditPageName = null ): self
111120 {
112121 $ this ->setCustomOption (self ::OPTION_RENDER_AS_EMBEDDED_FORM , true );
0 commit comments