Ejemplo n.º 1
0
 public function chunk(Element $element)
 {
     $size = $element->getAttribute('data-size')->getValue();
     $chunks = array_map(function ($chunk) {
         return new ListModel($chunk);
     }, array_chunk($this->item, $size));
     return $chunks;
 }
Ejemplo n.º 2
0
 private function wrapAsset(Element $element, $attributeName)
 {
     $attribute = $element->getAttribute($attributeName);
     if (!$attribute) {
         return;
     }
     $url = Url::fromString($attribute->getValue());
     if ($url->isAbsolute()) {
         return;
     }
     $path = $url->getPath();
     $path->insertAll($this->path->slice(0, -1), 0);
     $url->setPath($path);
     $element->setAttribute($attributeName, $url->toString());
 }
Ejemplo n.º 3
0
 private function getPropertyName(Element $element)
 {
     return $element->getAttribute('property')->getValue();
 }