Jump to content

where is the form processing code?


bmacnaughton
 Share

Recommended Posts

Is this what you are looking for: https://github.com/ryancramerdesign/ProcessWire/blob/7e8c7c6836282b6b64de81263f5aaa8112fd51ae/wire/modules/Inputfield/InputfieldForm.module#L95

Remember though that each fieldtype (textarea, text, integer, file, image, etc) is defined and processed by the Inputfield (https://github.com/ryancramerdesign/ProcessWire/tree/master/wire/modules/Inputfield/InputfieldImage) and Fieldtype (https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeImage.module) modules.

Those links are to the Image field.

If that doesn't help, maybe let us know a little more about what you are trying to do.

Link to comment
Share on other sites

This is a good start. Let me look over it and see if I have further questions.

Slightly more specifically, I'm trying to do two things - one immediate, one longer term.

Immediately, I'm trying to figure out what setting $form->message() does. It's not clear to me what happens when that call is executed.

Longer term, I'm trying to become familiar with the (mostly) undocumented form capabilities.

Link to comment
Share on other sites

https://github.com/ryancramerdesign/ProcessWire/search?utf8=✓&q="function+message"

That should give you an idea of what the message() method does in various contexts. Basically it is for sending a message (green for success). You can also use: error() for red.

https://github.com/ryancramerdesign/ProcessWire/search?utf8=✓&q="function+error"

The default method for each of these is the one in the Wire.php file

Most(all?) of the versions are in classes that extend Wire, so they are extending that base method.

  • Like 1
Link to comment
Share on other sites

Have you tried $field->message() ?

Personally I have used $session->message() with success - I honestly haven't looked into it properly, but maybe it's a page reload issue which is why the session version works. Maybe someone else has used these more or looked into exactly what is going on a little more thoroughly.

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...