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.
Move witgets classes to
layout
directory. (#321)
- Loading branch information
1 parent
8cc7a94
commit 72d1d5e
Showing
45 changed files
with
178 additions
and
145 deletions.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PHPForge\Html\Attribute\Custom; | ||
|
||
use PHPForge\Html\Helper\Encode; | ||
|
||
/** | ||
* Is used by widgets that implement the content attribute. | ||
*/ | ||
trait HasContentAttribute | ||
{ | ||
/** | ||
* Sets the content attributes. | ||
* | ||
* @param string $value The content value. | ||
* | ||
* @return static A new instance of the current class with the specified content value. | ||
*/ | ||
public function content(string $value): static | ||
{ | ||
$new = clone $this; | ||
$new->attributes['content'] = Encode::content($value); | ||
|
||
return $new; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -41,6 +41,7 @@ final class Attributes | |
'id', | ||
'name', | ||
'type', | ||
'http-equiv', | ||
'value', | ||
'href', | ||
'src', | ||
|
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
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
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,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PHPForge\Html\Layout; | ||
|
||
use PHPForge\Html\Attribute\Custom\HasAttributes; | ||
use PHPForge\Html\Attribute\Custom\HasContentAttribute; | ||
use PHPForge\Html\Attribute\Input\HasName; | ||
use PHPForge\Html\Attribute\Tag\{HasCharset, HasHttpEquiv}; | ||
use PHPForge\Html\Attribute\{HasClass, HasId, HasLang, HasStyle}; | ||
use PHPForge\Html\Tag; | ||
use PHPForge\Widget\Element; | ||
|
||
/** | ||
* The `<meta>` HTML element represents metadata that cannot be represented by other HTML meta-related elements, | ||
* like `<base>`, `<link>`, `<script>`, `<style>`, or `<title>`. | ||
* | ||
* @link https://html.spec.whatwg.org/multipage/semantics.html#the-meta-element | ||
*/ | ||
final class Meta extends Element | ||
{ | ||
use HasAttributes; | ||
use HasCharset; | ||
use HasClass; | ||
use HasContentAttribute; | ||
use HasHttpEquiv; | ||
use HasId; | ||
use HasLang; | ||
use HasName; | ||
use HasStyle; | ||
|
||
private array $attributes = []; | ||
|
||
/** | ||
* Generate the HTML representation of the element. | ||
* | ||
* @return string The HTML representation of the element. | ||
*/ | ||
protected function run(): string | ||
{ | ||
return Tag::widget()->attributes($this->attributes)->id($this->id)->tagName('meta')->render(); | ||
} | ||
} |
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.