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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# 0.1.1 Under development

- Enh #3: Implement interface `RenderInterface::class` (@terabytesoftw)

## 0.1.0 February 27, 2024

- Initial release
20 changes: 10 additions & 10 deletions src/InputInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@
/**
* Provide methods for handling HTML input-related attributes.
*/
interface InputInterface
interface InputInterface extends RenderInterface
{
/**
* Set the `HTML` attributes.
*
* @param array $values Attribute values indexed by attribute names.
*
* @return static A new instance of the current class with the specified attributes.
*/
public function attributes(array $values): static;

/**
* Set the `CSS` `HTML` class attribute.
*
Expand All @@ -21,15 +30,6 @@ interface InputInterface
*/
public function class(string $value, bool $override = false): static;

/**
* Set the `HTML` attributes.
*
* @param array $values Attribute values indexed by attribute names.
*
* @return static A new instance of the current class with the specified attributes.
*/
public function attributes(array $values): static;

/**
* Generate the id and name attributes for the field.
*
Expand Down
22 changes: 22 additions & 0 deletions src/RenderInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace PHPForge\Html\Interop;

use Stringable;

/**
* Provide methods for handling HTML rendering.
*/
interface RenderInterface extends Stringable
{
/**
* Executes the widget.
*
* This method is responsible for executing the widget and returning the result of the execution as a string.
*
* @return string The result of widget execution to be outputted.
*/
public function render(): string;
}