Aiki Forms
From Aikiframework wiki
|
We are in the process of assessing Aiki Forms since they are not very normal human friendly. Please help us by documenting them here, and informing us of what you want here: Aiki Forms 2 |
The original aiki has Aiki Forms, functionality for simplifying the creation of forms from database tables. This page is documentation of these fields.
|
HOWTO Make an Aiki Form
Tables and Forms
The database and Forms tab allows one to edit the tables in the aiki database and the forms that are used to interact with the table. Please note, for Aiki to automatically generate a form for a table there must be at least one valid entry in the table, this is done when a table is clicked for the first time.
You may access information from a database by supplying a SQL statement that selects desired data, and entering basic aiki markup inside the content field within the HTML.
((field_name))
You can control the number of records per page and per row, and pagination will automatically be generated, given a valid link example.
You may also use Aiki Markup to create form actions such as delete, edit, or create.
(#(form : action : id)#) :Example: (#(form:add:21)#)
action - add, delete,edit id - Id of form.
Each field in the database will be represented by two fields in the editor. The first is a drop down menu containing types of field definitions. The second is a text input where Aiki markup is used to modify the behavior of the field.
Field Definitions
tablename Defines what the table is named. This value is not editable beyond the admin interface, as is the pkey field.
pkey Defines what field is the primary key. It is a good practice to leave this value alone.
textinput textblock Creates a textinput or textblock field to enter data into. You may also define the name of the field, and the title that is displayed in the viewing environment.
Example: tablename => 'aiki_sites' pkey => 'site_id' textinput1 => 'site_name|SystemGOD:site name' textinput2 => 'site_shortcut|SystemGOD:site shortcut' textinput3 => 'is_active|SystemGOD:is active' textblock4 => 'if_closed_output|SystemGOD:if closed output'
fieldname | permissions : title -example- title|SystemGOD:Title
static select This field allows you to create a drop down menu with defined names & values. This allows you to control exactly what is entered into the field by a user. You may continue to append other menu selections by repeating the sequence with an ampersand.
fieldname | permissions : title : custome : select name > select value & select name > select value -example- is_father|SystemGOD:Is Father:custome:No>0&Yes>1
dynamic select Aiki Forms also allow you to create select boxes that are populated with values from a database. (NOTE: the conditional statements can't compare strings because quotes inserted into the conditional section break the form completely)
fieldname | Permission_Level : Title Displayed on Form Output : TABLE : VALUE TO SEND TO DB : FIELD NAME to display in select box : CONDITIONAL(optional) -example- usergroup|SystemGOD:User Group:aiki_users_groups:id:name:where id = (1)
send_email Sends an email after the form is submitted (successfully). If the form has an "email" input where the user enters his or her email, this value is available using the [email] tag. The message portion of send_email accepts valid HTML.
to | from | subject | message -example- [email] | Admin <admin@my_aiki_site.example.com> | Welcome to my site! | Thank you for submitting your info.
events Runs some other event after the form is submitted. Multiple events can be separated by a |
-example- on_submit:assets/extensions/my_script.php?user=this_pkey|on_submit:redirect:/users/sign_in
See Related Pages
- Auto generate a form
- Defining db tables and fields
- Autoform Fields
- Aiki Documentation
- Aiki Forms/CRUD Tutorial

