-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from Fedik/form-control-fields
Form control fields new feature
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# New features | ||
|
||
#### Form control fields | ||
|
||
New methods to manage form control fields. | ||
More detail at [Form Control fields](../../docs/general-concepts/forms/manipulating-forms#control-fields) | ||
|
||
PR: https://github.com/joomla/joomla-cms/pull/43857 | ||
|
||
**Example** | ||
|
||
Before: | ||
```html | ||
<input type="hidden" name="task" value=""> | ||
<input type="hidden" name="foo" value="bar"> | ||
<input type="hidden" name="return" value="<?php echo $input->getBase64('return'); ?>"> | ||
<?php echo HTMLHelper::_('form.token'); ?> | ||
``` | ||
|
||
After: | ||
```php | ||
// Code in Controller/View | ||
$this->form | ||
->addControlField('task', '') | ||
->addControlField('foo', 'bar') | ||
->addControlField('return', $input->getBase64('return', '')); | ||
|
||
// Code in the form layout | ||
echo $this->form->renderControlFields(); | ||
``` |