Skip to content

Commit 70c125a

Browse files
committed
Add window target configuration on URL action
1 parent e39076b commit 70c125a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/DataView/Action.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,19 @@ public static function modal( string $id, string $label, string $url, bool $is_h
143143
*
144144
* @since $ver$
145145
*
146-
* @param string $id The unique ID of the action.
147-
* @param string $label The label of the action.
148-
* @param string $url The URL to open.
146+
* @param string $id The unique ID of the action.
147+
* @param string $label The label of the action.
148+
* @param string $url The URL to open.
149+
* @param bool $in_same_window Whether to op the url in the same window.
149150
*
150151
* @return self The action instance.
151152
*/
152-
public static function url( string $id, string $label, string $url ): self {
153+
public static function url( string $id, string $label, string $url, bool $in_same_window = false ): self {
153154
$action = new self( $id, $label );
154155
$action->type = self::TYPE_URL;
155156

156-
$action->context['url'] = $url;
157+
$action->context['url'] = $url;
158+
$action->context['use_new_window'] = ! $in_same_window;
157159

158160
return $action;
159161
}

0 commit comments

Comments
 (0)