Skip to content

Commit 6a904e8

Browse files
committed
wip
1 parent 071993a commit 6a904e8

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

packages/view/src/Elements/GenericElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function compile(): string
4141
$attributes = [];
4242

4343
foreach ($this->getAttributes() as $name => $value) {
44-
if ($value) {
44+
if ($value !== null && $value !== '') {
4545
$attributes[] = $name . '="' . $value . '"';
4646
} else {
4747
$attributes[] = $name;

src/Tempest/Framework/Commands/MetaViewComponentCommand.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ private function resolveViewComponent(string $viewComponent): ?ViewComponent
7373
$viewComponent = $this->viewConfig->viewComponents[$viewComponent] ?? null;
7474
}
7575

76-
if ($viewComponent === null) {
77-
return null;
78-
}
79-
8076
return $viewComponent;
8177
}
8278

tests/Integration/View/TempestViewRendererTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,4 +856,13 @@ public function test_attributes_with_single_quotes(): void
856856

857857
$this->assertSnippetsMatch('<div class="hello"></div>', $html);
858858
}
859+
860+
public function test_zero_in_attribute(): void
861+
{
862+
$html = $this->render(<<<'HTML'
863+
<table border="0"></table>
864+
HTML);
865+
866+
$this->assertSnippetsMatch('<table border="0"></table>', $html);
867+
}
859868
}

0 commit comments

Comments
 (0)