WiFiManagerParameter Encapsulated HTML Generation #1774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR encapsulates the
WiFiManagerParameter
HTML generation as part of the class, rather than as a function withinWiFiManager
. This allows derived classes to define their own HTML output and greatly increases encapsulation:This also greatly simplifies the
getParamOut()
function ofWiFiManager
:This is a non-breaking change and should not modify the output HTML, with the exception of
{I}
as noted below.Note that this PR contains a potentially breaking change, by removing token I (
T_I
/{I}
/ capital 'i') processing for parameters which include that token in their string. This was removed because the parameter HTML is no longer generated in the context of the loop, and I didn't see a compelling reason to pass the iterator to the class function.From what I can see parsing through the history of the
strings_en
file that feature was never used by the library itself, but it could potentially affect a user somewhere with custom string files (HTTP_FORM_LABEL
/HTTP_FORM_PARAM
). If that's objectionable I'm happy to revert that commit (c4665fc).Please note that this PR incorporates the necessary API changes from #1773.