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
8 changes: 6 additions & 2 deletions Dom/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ public function bindTag(string $tag, string $key, bool $prepend = false): Elemen

/**
* Create (append) element
* @param string $element HTML tag (without brackets)
* @param string $value add value to tag
*
* @param string $element HTML tag (without brackets)
* @param null $value add value to tag
* @param string|null $bind
* @return ElementInterface
*/
public function create($element, $value = null, ?string $bind = null): ElementInterface
Expand Down Expand Up @@ -172,6 +174,7 @@ public function getTag(string $key): ?string
public function execute(?callable $call = null): string
{
$this->html = "";

if (is_null($this->elements)) {
if (method_exists($this, "withElement")) {
$inst = $this->withElement();
Expand All @@ -181,6 +184,7 @@ public function execute(?callable $call = null): string
if (is_array($this->elements)) {
$this->build($this->elements, $call);
}

return $this->html;
}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "maplephp/swiftrender",
"type": "library",
"version": "v2.0.0",
"version": "v2.0.1",
"description": "PHP SwiftRender is a pure and highly portable PHP template library.",
"keywords": ["output buffer", "template", "engine", "partials", "components", "views"],
"homepage": "https://wazabii.se",
Expand All @@ -18,7 +18,7 @@
],
"require": {
"php": ">=8.0",
"maplephp/dto": "^2.0",
"maplephp/dto": "^3.0",
"maplephp/container": "^1.0"
},
"autoload": {
Expand Down