-
Notifications
You must be signed in to change notification settings - Fork 0
Text Field
This will display a single line text input.
You can set the following attributes:
-
url URL template for each element (use [ITEM:ID] as a placeholder for the item id). This goes through the field tag replacement (see XML Form Fields)
-
show_link If true, a link will be appended around the field value (default false)
-
empty_replacement a string to show in place of the field when it's empty
-
size The size of the input in characters
-
maxlength The maximum acceptable input length in characters
-
readonly Is this a read-only field?
-
disabled Is this a disabled form field element?
-
format A string or translation key used to format the text data before it is displayed. Uses the
format()
PHP function's syntax. -
format_if_not_empty Should we apply the format string even when the field is empty? Default: true
-
parse_value If set to true, the value of the field will go through the field tag replacement (see below) Default: false
-
format_source_file, format_source_class and format_source_method Class definition to format the text data before it is displayed.
You can reference values from other fields inside your text. See XML Form Fields.
FOF also recognises the special tag [ITEM:ID]
, replacing it with the value of the key field of the table.
Other model fields can be accessed with the notation [ITEM:FIELDNAME]
where FIELDNAME
is the name of your field in all uppercase. For example, if your item has a field called foo_bar
you can get its value using the special tag [ITEM:FOO_BAR]
. Do keep in mind that the field name MUST be in uppercase. This means that [ITEM:foo_bar]
and [ITEM:Foo_Bar]
will NOT work.
Moreover, you can use the special tag [TOKEN]
to add the form token. Typically this is added as &[TOKEN]=1
at the end of the URL.
Remember that the url
attribute is used in an XML file. As such, you can't use an ampersand (&
) directly in the URL. You need to type it as the HTML entity &
. If you forget that then your XML will be invalid and FOF won't be able to load your form.
Sample URL definition: url="index.php?option=com_example&view=Foo&id=[ITEM:ID]&something=[ITEM:SOMETHING]&[TOKEN]=1"
FOF (Framework on Framework) and its documentation are Copyright © 2010-2020 Nicholas K. Dionysopoulos / Akeeba Ltd.
FOF is Open Source Software, distributed under the GNU General Public License, version 2 of the license, or (at your option) any later version.
The FOF Wiki content is provided under the GNU Free Documentation License, version 1.3 of the license, or (at your option) any later version.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license can be found on the GNU site.