| 1 | <?php |
||
| 10 | trait HasAttributes |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var Attributes |
||
| 14 | */ |
||
| 15 | protected $attributes; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Get attributes object. |
||
| 19 | * If send \Closure option as parameter then returned callback result. |
||
| 20 | * |
||
| 21 | * @param callable|null $callback |
||
| 22 | * @return Attributes|mixed |
||
| 23 | */ |
||
| 24 | 4 | public function getAttributes($callback = null) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Build attributes to html valid string |
||
| 35 | * |
||
| 36 | * @param array $attributes |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | 11 | public function buildAttributes($attributes = []) |
|
| 43 | } |