Form Plugin for Flextype
Form Plugin to render user forms for Flextype.
The following dependencies need to be installed for Form Plugin.
Item | Version | Download |
---|---|---|
flextype | 0.9.16 | download |
twig | >=2.0.0 | download |
jquery | >=1.0.0 | download |
- Download & Install all required dependencies.
- Create new folder
project/plugins/form/
- Download Form Plugin and unzip plugin content to the folder
project/plugins/form/
Fieldsets are configuration files written in YAML for Admin Panel to create publish forms. They establish your content model. Essentially, a schema that defines your fields, data types, and the interface used to manage them.
- Text
- Number
- Password
- Textarea
- HTML
- Hidden
- Heading
- Select
- Select Template
- Select Visibility
- Select Routable
- Select Media
- Tags
- Date Time Picker
The plain text field for short text blocks or a short paragraph of information related to a item–basic text content that doesn't need special formatting.
Common uses: Short-form text that doesn't need any formatting; Product titles; Event names
form:
fields:
title:
title: Title
type: text
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
default |
string | Default value for the field, which will be used when entry is created | |
class |
string | CSS class | |
validation.required |
boolean | Set is this field required or not. Set true or false |
|
validation.pattern |
string | Validation pattern | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
The email field for email text blocks.
form:
fields:
email:
title: Email
type: email
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
default |
string | Default value for the field, which will be used when entry is created | |
class |
string | CSS class | |
validation.required |
boolean | Set is this field required or not. Set true or false |
|
validation.pattern |
string | Validation pattern | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
The number field for number blocks.
form:
fields:
number:
title: Number
type: number
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
default |
string | Default value for the field, which will be used when entry is created | |
class |
string | CSS class | |
validation.required |
boolean | Set is this field required or not. Set true or false |
|
validation.pattern |
string | Validation pattern | |
min | int | Minimum value for number field | |
max | int | Maximum value for number field | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
The password field for password text blocks
form:
fields:
password:
title: Password
type: password
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
default |
string | Default value for the field, which will be used when entry is created | |
class |
string | CSS class | |
validation.required |
boolean | Set is this field required or not. Set true or false |
|
validation.pattern |
string | Validation pattern | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
While a plain text field is used for creating short-form, a textarea field is used for long-form content.
Common uses: Long-form text that doesn't need any formatting; Product descriptions; Event descriptions
form:
fields:
message:
title: Message
type: textarea
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
default |
string | Default value for the field, which will be used when entry is created | |
class |
string | CSS class | |
validation.required |
boolean | Set is this field required or not. Set true or false |
|
validation.pattern |
string | Validation pattern | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
While a textarea field is used for creating long-form, unformatted text, a html field is used for long-form content that you can format. The html field gives your collaborators freedom to create and format your content.
Common uses: Most long-form content with links; Blog posts; Articles; Team member bios; Product description; Event details.
We are using Trumbowyg - a very small but powerful WYSIWYG editor created by Alexandre Demode (@Alex-D)
form:
fields:
content:
title: Content
type: html
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
default |
string | Default value for the field, which will be used when entry is created | |
class |
string | CSS class | |
validation.required |
boolean | Set is this field required or not. Set true or false |
|
validation.pattern |
string | Validation pattern | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
The hidden field allows storing values in the content file that are not visible to users. This can be useful to store additional information for a page, which is only available to the developer or editors who have access to the filesystem. Such a hidden field can be edited only either directly in the filesystem or programmatically via a script.
form:
fields:
hidden:
title: Hidden
type: hidden
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
default |
string | Default value for the field, which will be used when entry is created | |
class |
string | CSS class | |
validation.required |
boolean | Set is this field required or not. Set true or false |
|
validation.pattern |
string | Validation pattern | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
The heading field helps to group larger sets of fields.
form:
fields:
heading:
title: Heading
type: heading
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
h |
int | 3 | Heading size from 1 to 6 |
The heading field helps to group larger sets of fields.
form:
fields:
genre:
title: Genre
type: select
options:
action: Action
adventure: Adventure
horror: Horror
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
options |
array | Array of options | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
Template select field for selecting entry template.
form:
fields:
template:
title: Template
type: select_template
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
Visibility select field for selecting entry visibility state.
form:
fields:
visibility:
title: Visibility
type: select_visibility
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
Routable select field for selection entry routable state.
form:
fields:
routable:
title: Routable
type: select_routable
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
Media select field for selection media for entry.
form:
fields:
cover:
title: Media
type: select_media
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
An interactive tags input field.
form:
fields:
tags:
title: Tags
type: tags
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
The datetimepicker field lets you specify a date and time.
form:
fields:
published_at:
title: Tags
type: datetimepicker
Property | Type | Default | Description |
---|---|---|---|
title |
string | The field label title | |
help |
string | Optional help text below the field | |
size |
string | 12 | The width of the field in the field grid. Available widths: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12, full, min, max, screen |
class |
string | CSS class | |
events.onkeyup |
string | The onkeyup event occurs when the user releases a key (on the keyboard). | |
events.onmousedown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onmousemove |
string | The onmousemove event occurs when the pointer is moving while it is over an element. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseout |
string | The onmouseout event occurs when the mouse pointer is moved out of an element, or out of one of its children. | |
events.onmouseover |
string | The onmouseover event occurs when the mouse pointer is moved onto an element, or onto one of its children. | |
events.onmouseup |
string | The onmouseup event occurs when a user releases a mouse button over an element. | |
events.onkeypress |
string | The onkeypress event occurs when the user presses a key (on the keyboard). | |
events.onkeydown |
string | The onkeydown event occurs when the user is pressing a key (on the keyboard). | |
events.onclick |
string | The onclick event occurs when the user clicks on an element. | |
events.ondblclick |
string | The ondblclick event occurs when the user double-clicks on an element. | |
events.onblur |
string | The onblur event occurs when an object loses focus. |
project/fieldsets/default.yaml
title: Default
default_field: title
icon:
name: "file-alt"
set: "fontawesome|solid"
size: 12
form:
name: default
id: default
method: post
messages:
success: true
error: true
buttons:
submit:
title: Submit
type: submit
tabs:
main:
title: admin_main
fields:
title:
title: admin_title
type: text
size: 12
content:
title: admin_content
type: html
size: 12
settings:
title: admin_settings
fields:
general_heading:
title: admin_general
type: heading
description:
title: admin_description
type: textarea
size: 12
visibility:
title: admin_visibility
type: select_visibility
size: 4/12
published_at:
title: admin_published_at
type: datetimepicker
size: 4/12
routable:
title: admin_routable
type: select_routable
size: 4/12
{% set registrationFormFilePath = PATH_PROJECT ~ '/fieldsets/default.yaml' %}
{% set registrationFormFileContent = filesystem().file(registrationFormFilePath).get() %}
{% set registrationForm = flextype.serializers.yaml.decode(registrationFormFileContent) %}
{{ flextype.form.render(registrationForm, {})|raw }}
use Flextype\Middlewares\CsrfMiddleware;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
flextype()->post('/route-name', function(Request $request, Response $response) {
// get post data
$post_data = $request->getParsedBody();
// save date from $post_data
flextype('entries')->create($post_data['name'], ['title' => $post_data['name']]);
// redirect
return $response->withRedirect('./');
})->add(new CsrfMiddleware());
The MIT License (MIT) Copyright (c) 2021 Sergey Romanenko