What are the possible field filters in the parameters of the Joomla module?

I am looking for a list of possible filters when adding parameter fields for module settings.

I know that filter = "raw" and filter = "integer" exist from examples in the Type field of a text form .

But what are the other possible filters for these fields?

+6
source share
3 answers

I'm not quite sure if this is the case, but may want to see this list directly from the code using the clean() method.

Thus, the list will look like this:

  • INT / INTEGER
  • UINT
  • FLOAT / DOUBLE
  • BOOL / BOOLEAN
  • WORD
  • number, letter
  • CMD
  • BASE64
  • LINE
  • HTML
  • ARRAY
  • PATH
  • USERNAME
  • RAW

Let me know if this helps.

+13
source

Posting as a guest so that I cannot comment;) You can also find a list of available field types useful for collecting data, such as URLs and emails. You can find the full list here . Also available in the folder structure in libraries/cms/form/field and libraries/joomla/form/fields . There are URL and email fields that I think include appropriate filtering. Usage in XML file:

 <field name="myAwesomeURL" type="url" class="awesome"></field> 

This is displayed as an input text box.

+2
source

To be precise, Joomla begins to apply a filter with this filterField function . In this code, you can see several types of filter , such as TEL , SAFEHTML or so on. From this function, if there is no match, it will go further than indicated by @ValentinDespa. It also allows you to call your own function if it is "called". I recognized this scatter after I looked at the code by another developer having filter="intval" .

Hope this helps!

+2
source

Source: https://habr.com/ru/post/951837/


All Articles