Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions panel/lab/internals/panel/urls/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
<k-code>{{ $panel.urls.api }}</k-code>
</k-text>
</k-lab-example>
<k-lab-example label="panel" :code="false">
<k-text>
<p>
<code>window.panel.urls.panel</code> returns the base URL for the
Panel
</p>
<k-code>{{ $panel.urls.panel }}</k-code>
</k-text>
</k-lab-example>
<k-lab-example label="site" :code="false">
<k-text>
<p>
Expand Down
5 changes: 3 additions & 2 deletions src/Panel/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,9 @@ public function url(): string
public function urls(): array
{
return [
'api' => $this->kirby->url('api'),
'site' => $this->kirby->url('index')
'api' => $this->kirby->url('api'),
'panel' => $this->kirby->url('panel'),
'site' => $this->kirby->url('index')
];
}

Expand Down
6 changes: 4 additions & 2 deletions tests/Panel/StateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ public function testFilterOnlyRequestWithGlobal(): void
$expected = [
'a' => 'A',
'urls' => [
'api' => '/api',
'site' => '/'
'api' => '/api',
'panel' => '/panel',
'site' => '/'
]
];

Expand Down Expand Up @@ -487,6 +488,7 @@ public function testUrls(): void
$state = new State();
$urls = $state->urls();
$this->assertArrayHasKey('api', $urls);
$this->assertArrayHasKey('panel', $urls);
$this->assertArrayHasKey('site', $urls);
}

Expand Down
Loading