generated from yii-tools/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HasSrc.php
29 lines (25 loc) · 771 Bytes
/
HasSrc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare(strict_types=1);
namespace UIAwesome\Html\Attribute;
/**
* Is used by widgets that implement the src method.
*/
trait HasSrc
{
/**
* Set the source attribute valid for the image input button or img only, the src is string specifying the URL of
* the image file to display to represent the graphical submitted button.
*
* @param string|null $value The source of the widget.
*
* @return static A new instance of the current class with the specified source value.
*
* @link https://www.w3.org/TR/html52/embedded-content-0.html#attr-img-srcset
*/
public function src(string $value = null): static
{
$new = clone $this;
$new->attributes['src'] = $value;
return $new;
}
}