Jump to content

InputfieldHelper


ukyo
 Share

Recommended Posts

InputfieldHelper for ProcessWire v3

Module DirectoryGithub repo

This module extends base `ModuleConfig` class add some features to this class.

This module creates Inputfields from array configs.

I used this module for create module configuration panel for WirePHPMailer module. You can see configs here.

Also you can use this module for create forms from array.You can check github repo for usage.

Link to comment
Share on other sites

hi @ukyo

thanks for the phpmailer module - I've built one my own since I was not happy with the other options, but it was not polished enough to release it :)

I'm not sure, though, what is the difference between your inputfieldhelper and the default module config? https://processwire.com/blog/posts/new-module-configuration-options/#using-an-array-to-define-module-configuration

you can also add fields to a form via array:

Quote

Alright… you guys that wanted arrays for defining Inputfields–I have to admit this is most definitely a good thing. So as a bonus (stepping outside module configuration for a moment), you can now use these arrays anywhere that you use Inputfields. Simply pass an array like the above to any InputfieldWrapper, InputfieldForm, or InputfieldFieldset via the add() method, and it will set it all up for you, i.e $form->add(array( ... ));

 

  • Like 1
Link to comment
Share on other sites

43 minutes ago, bernhard said:

hi @ukyo

thanks for the phpmailer module - I've built one my own since I was not happy with the other options, but it was not polished enough to release it :)

I'm not sure, though, what is the difference between your inputfieldhelper and the default module config? https://processwire.com/blog/posts/new-module-configuration-options/#using-an-array-to-define-module-configuration

you can also add fields to a form via array:

 

 

I am using it for different cases.

For modules (everything from a config file) :

I am not defining default values as you see here : https://github.com/trk/WirePHPMailer/blob/master/WirePHPMailer.module#L33

Getting module configs : https://github.com/trk/WirePHPMailer/blob/master/WirePHPMailer.module#L77

Settings default values : https://github.com/trk/WirePHPMailer/blob/master/WirePHPMailer.module#L78

Merging module values with defaults, building inputfields : https://github.com/trk/WirePHPMailer/blob/master/WirePHPMailer.module#L119

- Its easy to build configurable module for me, no need to set all things on different places.

For creating form you can see simple example usage on README.md

I am using it for creating dynamic fields for page templates on runtime by hooking ProcessPageEdit::buildForm. In screenshots Settings and General tabs added dynamically and fields inside these tabs added by a config file.

5a954e1a5c421_EkranResmi2018-02-2715_23_29.thumb.png.07bf2098695eaaaaf0db3bb5c28ab913.png

5a954e2137309_EkranResmi2018-02-2715_23_41.thumb.png.d938f34cb70cccd086df4288c0859e49.png

5a954e82219a3_EkranResmi2018-02-2715_26_17.thumb.png.01ec280ac77268c34b87409fcb9e75c9.png

Use case change up to you.

  • Like 3
Link to comment
Share on other sites

  • 2 years later...

hi : if u still support this module. can u fix this : 

item markup not set properly. (<div class='uk-width-1-4@m uk-margin-top'>{out}</div>)
ProcessWire 3.0.165

image.png.d5675a4f46588896a29d3b279a91a153.png

$iHelper->markup = array(
	"list" => "<div class='uk-grid'>{out}</div>",
	"item" => "<div class='uk-width-1-4@m uk-margin-top'>{out}</div>",
	"InputfieldSubmit" => array(
		"item" => "<div class='uk-width-1-4 uk-text-right@m uk-margin-top'>{out}</div>",
	)
);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...