-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBinder.php
53 lines (46 loc) · 1.15 KB
/
Binder.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Gt\DomTemplate;
use Gt\Dom\Element;
abstract class Binder {
abstract public function bindValue(
mixed $value,
null|string|Element $context = null
):void;
/**
* Applies the string value of $value to any elements within $context
* that have the data-bind attribute matching the provided key.
*/
abstract public function bindKeyValue(
string $key,
mixed $value,
null|string|Element $context = null
):void;
/**
* Binds multiple key-value-pairs to any matching elements within
* the $context element.
*/
abstract public function bindData(
mixed $kvp,
null|string|Element $context = null
):void;
abstract public function bindTable(
mixed $tableData,
null|string|Element $context = null,
?string $bindKey = null
):void;
/**
* @param iterable<int, mixed> $listData
*/
abstract public function bindList(
iterable $listData,
null|string|Element $context = null,
?string $templateName = null
):int;
/** @param iterable<int, mixed> $listData */
abstract public function bindListCallback(
iterable $listData,
callable $callback,
null|string|Element $context = null,
?string $templateName = null
):int;
}