mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Form fields can now be marked as hidden
This commit is contained in:
parent
2c4317f8f2
commit
8d5253930d
@ -83,6 +83,11 @@ class FormField
|
||||
*/
|
||||
public $disabled = false;
|
||||
|
||||
/**
|
||||
* @var bool Specify if the field is hidden. Hiddens fields are not included in postbacks.
|
||||
*/
|
||||
public $hidden = false;
|
||||
|
||||
/**
|
||||
* @var bool Specifies if this field stretch to fit the page height.
|
||||
*/
|
||||
@ -245,6 +250,7 @@ class FormField
|
||||
|
||||
if (array_key_exists('required', $config)) $this->required = $config['required'];
|
||||
if (array_key_exists('disabled', $config)) $this->disabled = $config['disabled'];
|
||||
if (array_key_exists('hidden', $config)) $this->hidden = $config['hidden'];
|
||||
if (array_key_exists('stretch', $config)) $this->stretch = $config['stretch'];
|
||||
|
||||
if (isset($config['valueFrom'])) $this->valueFrom = $config['valueFrom'];
|
||||
|
@ -1,3 +1,4 @@
|
||||
<?php foreach ($fields as $field): ?>
|
||||
<?php if ($field->hidden) continue; ?>
|
||||
<?= $this->makePartial('field-container', ['field' => $field]) ?>
|
||||
<?php endforeach ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user