Jump to content

Recommended Posts

Posted

I'm looking for the module(s) that contain the code used to define and process forms. I don't see anything in the dist/wire/* directories that has 'form' in the name.

Does anyone know where this code is?

Posted

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.

Posted

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.

Posted

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
Posted

Messages don't seem to show up in forms. If I set $form->message() it doesn't show up anywhere in the rendered HTML. But if I set $field->error() that shows up.

I'd like to set information messages associated with a form.

What am I missing?

Posted

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.

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
×
×
  • Create New...