generated from yii-tools/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LabelInterface to AbstractChoice. (#160)
- Loading branch information
1 parent
a3e1c04
commit bb89d48
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PHPForge\Html\Input; | ||
|
||
use PHPForge\Widget\ElementInterface; | ||
|
||
interface LabelInterface | ||
{ | ||
/** | ||
* Set the `HTML` attributes for the label. | ||
* | ||
* @param array $values Attribute values indexed by attribute names. | ||
* | ||
* @return static A new instance of the current class with the specified label attributes. | ||
*/ | ||
public function labelAttributes(array $values): static; | ||
|
||
/** | ||
* Set the `CSS` class for the label. | ||
* | ||
* @param string $value The value of the class attribute. | ||
* @param bool $override If `true` the value will be overridden. | ||
* | ||
* @return static A new instance of the current class with the specified label class. | ||
*/ | ||
public function labelClass(string $value, bool $override = false): static; | ||
|
||
/** | ||
* Set the `HTML` label content. | ||
* | ||
* @param ElementInterface|string $values The `HTML` label content value. | ||
* | ||
* @return static A new instance of the current class with the specified `HTML` label content. | ||
*/ | ||
public function labelContent(string|ElementInterface ...$values): static; | ||
|
||
/** | ||
* Set the `for` attribute for the label. | ||
* | ||
* @param string|null $value The value for the `for` attribute. | ||
* | ||
* @return static A new instance of the current class with the specified label `for` attribute. | ||
*/ | ||
public function labelFor(string|null $value): static; | ||
|
||
/** | ||
* Disable the label rendering. | ||
* | ||
* @return static A new instance of the current class with the label disabled. | ||
*/ | ||
public function notLabel(): static; | ||
|
||
/** | ||
* Determine if the label is disabled or not. | ||
* | ||
* @return bool `true` if the label is disabled, `false` otherwise. | ||
*/ | ||
public function isNotLabel(): bool; | ||
} |