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

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

Adds hidden form control used to store a non-displayed value.
public addHidden ( $name, $default = NULL ) : HiddenField
Результат Nette\Forms\Controls\HiddenField
    public function addHidden($name, $default = NULL)
    {
        return $this[$name] = (new Controls\HiddenField())->setDefaultValue($default);
    }

Usage Example

Пример #1
0
 public function addIdentifiers()
 {
     $components = [];
     foreach ($this->metadata->getIdentifierFieldNames() as $name) {
         if (!isset($this->containerPrototype[$name])) {
             $components[$name] = $this->containerPrototype->addHidden($name);
         }
     }
     return $components;
 }