Jump to content

Recommended Posts

Posted

Where can I find a list of all field types?

I've been to http://modules.processwire.com/categories/fieldtype/ and http://modules.processwire.com/categories/inputfield/. But while they list a number of field types they don't seem to list the basics, e.g., InputfieldText, InputfieldHidden, InputfieldSubmit. I am seeing these in the context of $field = wire('modules')->get('InputfieldText').

If someone can just point me at documentation for constructing fields in this way it would be great. In particular I'm looking for a list of the field types and what classes get attached to the items (or how classes are attached to them).

Posted

Thank you. I looked for it on the site; never really thought to look locally. But your answer highlights where built-in modules are stored - thank you.

This is also a missing piece for me in terms of how the API maps to the files that implement the function. Very useful answer.

Posted

You might also find this useful:

echo $fieldtypes->implode('<br />', 'name');

It will list out the names of all installed fieldtypes, both core and those from site modules that you have installed.

  • Like 5
Posted

Another thing you might be interested in is using ApiGen to generate docs for core. PW is fairly well documented in code apart from some places, and you'll find most of what you need there.

  • Like 3
Posted

Another thing you might be interested in is using ApiGen to generate docs for core. PW is fairly well documented in code apart from some places, and you'll find most of what you need there.

Yep, this is what I do. Make sure to tell it to generate docs from .module files as well, not just .php

  • Like 2
  • 3 months later...
Posted

I try to group Fields / Inputfields by needed sanitizer, but how should I do it?

I looked into the field objects (var_dump) and it looks like this won't work. 

I tested $field->class (InputfieldText has an empty class property?) and $field->type (InputfieldCKEditor is type text...?).

At the moment I have to use 

"class" to identify an FieldtypeTextarea (sanitizer textarea) and InputfieldEmail should be easy. All other fields I would set sanitizer "text" as default (overwrite / remove by custom value...).

Is there a consistent / simply way to group Inputfields by a proper sanitizer type?

Should sanitizer "groups" text, textarea and email enough as a basic and automatic sanitizing?

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