1 | <?php |
||
8 | class Repeat implements \Transphporm\Property { |
||
9 | private $functionSet; |
||
10 | private $elementData; |
||
11 | private $baseDir; |
||
12 | |||
13 | public function __construct(\Transphporm\FunctionSet $functionSet, \Transphporm\Hook\ElementData $elementData, &$baseDir) { |
||
18 | |||
19 | public function run(array $values, \DomElement $element, array $rules, \Transphporm\Hook\PseudoMatcher $pseudoMatcher, array $properties = []) { |
||
37 | |||
38 | private function cloneElement($element, $iteration, $key, $count) { |
||
39 | $clone = $element->cloneNode(true); |
||
40 | $this->tagElement($clone, $count); |
||
41 | |||
42 | $this->elementData->bind($clone, $iteration, 'iteration'); |
||
43 | $this->elementData->bind($clone, $key, 'key'); |
||
44 | $element->parentNode->insertBefore($clone, $element); |
||
45 | return $clone; |
||
46 | } |
||
47 | |||
48 | private function fixEmpty($value) { |
||
49 | if (empty($value[0])) $value[0] = []; |
||
50 | return $value; |
||
51 | } |
||
52 | |||
53 | private function tagElement($element, $count) { |
||
57 | |||
58 | private function getMax($values) { |
||
61 | |||
62 | private function createHook($newRules, $pseudoMatcher, $properties) { |
||
67 | } |
||
68 |