mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 00:37:02 +02:00
Add @netcarver PR #226 to fix unintentional assignment in conditional, plus minor phpdoc update in InputfieldWrapper
Co-authored-by: netcarver
This commit is contained in:
@@ -478,7 +478,7 @@ class InputfieldWrapper extends Inputfield implements \Countable, \IteratorAggre
|
||||
* Note: string or array values for either argument require 3.0.196+.
|
||||
*
|
||||
* ~~~~~
|
||||
* // example 1: Get existing Inputfields and change order
|
||||
* // example 1: Get existing Inputfields and insert first_name before last_name
|
||||
* $firstName = $form->getByName('first_name');
|
||||
* $lastName = $form->getByName('last_name');
|
||||
* $form->insertBefore($firstName, $lastName);
|
||||
@@ -504,7 +504,20 @@ class InputfieldWrapper extends Inputfield implements \Countable, \IteratorAggre
|
||||
/**
|
||||
* Insert one Inputfield after one that’s already there.
|
||||
*
|
||||
* Note: string or array values for either argument require 3.0.196+.
|
||||
* Note: string or array values for either argument require 3.0.196+.
|
||||
*
|
||||
* ~~~~~
|
||||
* // example 1: Get existing Inputfields, insert last_name after first_name
|
||||
* $lastName = $form->getByName('last_name');
|
||||
* $firstName = $form->getByName('first_name');
|
||||
* $form->insertAfter($lastName, $firstName);
|
||||
*
|
||||
* // example 2: Same as above but use Inputfield names (3.0.196+)
|
||||
* $form->insertBefore('last_name', 'first_name');
|
||||
*
|
||||
* // example 3: Create new Inputfield and insert after first_name (3.0.196+)
|
||||
* $form->insertAfter([ 'type' => 'text', 'name' => 'last_name' ], 'first_name');
|
||||
* ~~~~~
|
||||
*
|
||||
* #pw-group-manipulation
|
||||
*
|
||||
|
@@ -2821,9 +2821,9 @@ class ProcessTemplate extends Process implements ConfigurableModule {
|
||||
$value = $f->val();
|
||||
if($sanitizerName === 'int') {
|
||||
$value = (int) $value;
|
||||
} else if($sanitizerName = 'text') {
|
||||
} else if($sanitizerName === 'text') {
|
||||
$value = $sanitizer->text($value);
|
||||
} else if($sanitizerName = 'words') {
|
||||
} else if($sanitizerName === 'words') {
|
||||
$value = $sanitizer->words($value);
|
||||
} else {
|
||||
// use as-is
|
||||
|
Reference in New Issue
Block a user