Skip to content

Commit 03773a4

Browse files
wip
1 parent 60d69d0 commit 03773a4

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

src/Installer/app.view.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</head>
1212

1313
<body>
14-
<?= $this->page->render(id: 'app'); ?>
14+
<x-inertia />
1515
</body>
1616

1717
</html>

src/PageData.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,4 @@ public function jsonSerialize(): array
4747
{
4848
return $this->toArray();
4949
}
50-
51-
public function render(string $id): HtmlString
52-
{
53-
return HtmlString::createTag(
54-
tag: 'div',
55-
attributes: [
56-
'id' => $id,
57-
'data-page' => htmlentities(json_encode($this, JSON_THROW_ON_ERROR)),
58-
],
59-
);
60-
}
6150
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* @var NeoIsRecursive\Inertia\Views\InertiaBaseView $this
7+
* @var NeoIsRecursive\Inertia\PageData $page
8+
* @var string|null $id
9+
*/
10+
11+
?>
12+
13+
<div id="{{ $id ?? 'app' }}" data-page="{{ json_encode($page ?? $this->page) }}"></div>

tests/Fixtures/root.view.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
/** @var NeoIsRecursive\Inertia\Views\InertiaBaseView $this */ ?>
66

77
<main>
8-
<?= $this->page->render(id: 'app') ?>
9-
</main>
8+
<x-inertia />
9+
</main>

0 commit comments

Comments
 (0)