Nette\Forms\Container::getValues PHP Метод

getValues() публичный Метод

Returns the values submitted by the form.
public getValues ( $asArray = FALSE ) : Nette\Utils\ArrayHash | array
Результат Nette\Utils\ArrayHash | array
    public function getValues($asArray = FALSE)
    {
        $values = $asArray ? [] : new Nette\Utils\ArrayHash();
        foreach ($this->getComponents() as $name => $control) {
            if ($control instanceof IControl && !$control->isOmitted()) {
                $values[$name] = $control->getValue();
            } elseif ($control instanceof self) {
                $values[$name] = $control->getValues($asArray);
            }
        }
        return $values;
    }

Usage Example

Пример #1
0
 /**
  * @param bool $asArray
  * @return array|\movi\Model\IdentifiedEntity[]|\Nette\ArrayHash
  */
 public function getValues($asArray = FALSE)
 {
     $values = parent::getValues(false);
     foreach ($values as $id => $selected) {
         if ($selected) {
             $this->selected[$id] = $this->items[$id];
         }
     }
     return $this->selected;
 }
All Usage Examples Of Nette\Forms\Container::getValues