Beispiel #1
0
 /**
  * @return string
  */
 public function render()
 {
     $attributes = '';
     foreach ($this->attributes->getAll() as $type => $values) {
         $attributes .= $this->renderField($type, $this->renderAttributeValues($values));
     }
     return $attributes;
 }
Beispiel #2
0
 /**
  * Returns the data from a specific request method.
  *
  * @return array
  */
 public function getData()
 {
     $data = json_decode(file_get_contents(static::INPUT_STREAM), true);
     if ($data) {
         return array_merge($this->data->getAll(), $data);
     }
     if ($this->isMethod(self::GET)) {
         return array_merge($this->data->getAll(), $_GET);
     }
     if ($this->isMethod(self::POST)) {
         return array_merge($this->data->getAll(), $_POST);
     }
     return [];
 }
 /**
  * @param string $classes
  * @return ElementContainer
  */
 public function addCssClasses($classes)
 {
     /** @var AbstractElement[] $elementsIterator */
     $elementsIterator = $this->elements->getAll();
     foreach ($elementsIterator as $elements) {
         $elements->addCssClasses($classes);
     }
     return $this;
 }
Beispiel #4
0
 /**
  * @return array
  */
 public function getControllerDirectories()
 {
     return $this->controllerDirectories->getAll();
 }
Beispiel #5
0
 /**
  * @return array
  */
 public function getHeaders()
 {
     return $this->headers->getAll();
 }
Beispiel #6
-1
 /**
  * @return AbstractHtmlElement
  *
  * @throws NotExistsException
  */
 private function getSubmitElement()
 {
     $elementsIterator = $this->elements->getAll();
     foreach ($elementsIterator as $element) {
         if (ClassHelper::extractClass(get_class($element)) === 'SubmitElement') {
             return $element;
         }
     }
     throw new NotExistsException('The form "' . $this->attributes->get('id') . '" has no submit element.');
 }