This fixes the issue I reported, you can view it here: #21
Changes made:
I followed the same coding standards enforced by the file and any functions that were no longer needed I commented the same way other deprecated functions were.
Added HandleStringifiedField
Deprecated/removed extractFormData as this code is no longer used.
Deprecated/removed objectFromBluePrint as this code is no longer used.
Deprecated/removed reconcile as this code is no longer used.
How to test:
Nameless indices
<input type="text" name="todo[]" value="Clean the bathroom"> <!-- Will be treated as todo[0] -->
<input type="text" name="todo[]" value="Pick up milk"> <!-- Will be treated as todo[1] -->
Result:
[
"Clean the bathroom", // 0
"Pick up milk" // 1
]
Named indices
<input type="text" name="todo[Bathroom]" value="Clean me!"> <!-- Will be treated as todo[Bathroom] -->
<input type="text" name="todo[Milk]" value="Buy me!"> <!-- Will be treated as todo[Milk] -->
Result:
{
Bathroom: "Clean me!",
Milk: "Buy me!"
}
Mixing nameless and named indices.
Mixing nameless and named indices for the same field causes issues and is discouraged; however it is possible. There may be a workaround in the future, but for now this is the best way for implementation.
Nameless first.
<input type="text" name="todo[]" value="Clean me!"> <!-- Will be treated as todo[0] -->
<input type="text" name="todo[Milk]" value="Buy me!"> <!-- Will be treated as todo[1] -->
Result:
[
"Clean me!", // 0
"Buy me!" // 1
]
Named first.
<input type="text" name="todo[Bathroom]" value="Clean me!"> <!-- Will be treated as todo[Bathroom] -->
<input type="text" name="todo[]" value="Buy me!"> <!-- Will be treated as todo[""] -->
As much as I appreciate the work that you have done here (beautifully formated PR 👍 !). This exact issue has aleady been solve by #6 that was prior to yours. Thanks a lot for contributing.
This fixes the issue I reported, you can view it here: #21
Changes made:
I followed the same coding standards enforced by the file and any functions that were no longer needed I commented the same way other deprecated functions were.
How to test:
Nameless indices
Result:
Named indices
Result:
Mixing nameless and named indices.
Mixing nameless and named indices for the same field causes issues and is discouraged; however it is possible. There may be a workaround in the future, but for now this is the best way for implementation.
Nameless first.
Result:
Named first.
Result: