CakePHP - Form Options
From Gruff Goat Wiki
CakePHP allows rapid development of simple to complex forms. Many of these are single purpose forms developed for clients. In order to insure ease of use for clients, many forms have a variety of fields or oprions which may be set using form_options.
Contents |
General Features
Some features of form_options are generic and apply to all users. A number of entry fields are defined and examples of a correct entry are given.- id - an automatically generated UUID
- model_name - The name of the form you wish to manage. Usually in camel case.
- egs: RealHero, Donation, ContactUs
- field_name - The name of the form field to manage. Often a single word, sometimes multiple words separated by an underscore.
- egs: first_name, address, amount
- field_type - The type of value that will be set. It may take one of the following values
- numeric
- plainText
- html
- date
- url
- telephone
- money
- is_list - Indicates whether the values entered are for a list.
- sort_order - Not yet used field control entry
- field_value - The value you would like to set for the form field. This could be almost anything including; a block of text, comment, date, address, email address, or link. There is no specific limit to the amount of information in this entry.
- created - automatic bookkeeping entry
- modified - automatic bookkeeping entry
- owner_id - automatic bookkeeping entry
- modified_by_id - automatic bookkeeping entry
- r_status - A field control entry that may take one of the following values
- published
- active
- inactive
- pending
- reviewed
- standby
- completed
- deleted
Client Specific Features
American Red Cross
Donation
About the form
The Donation form may be passed parameters via the URL. The available parameters are:
- CompanyName
- Selected donation_type
- The passed donation_type must match an available donation_type option. If the donation_type option contains spaces, replace each space with an underscore.
- Integer donation amount (i.e. 100)
These parameters are not allowed to contain spaces.
The allowed URLs are of the form:
https://www.redcrossinsewis.org/cake/donations/index/CompanyName https://www.redcrossinsewis.org/cake/donations/index/CompanyName/donation_type https://www.redcrossinsewis.org/cake/donations/index/CompanyName/donation_type/amount
Form options
The table shows the various options available in the Donation model.
| field_name | type | description |
|---|---|---|
| company | plainText, list | Company specific options that are used when the first passed parameter matches the companyName. The options are listed by this format: companyName(matching:TRUE),companyName2(matching:FALSE) |
| footer | html | Basic HTML used in the footer area. |
| header | html | Basic HTML used in the header area. |
| match_text | plainText | Text that is displayed in a required click through for companies with their match option set to TRUE. See company. |
| newsletter_name | Email address of a newsletter to subscribe to. | |
| newsletter_option | plainText, TRUE/FALSE | Display the option to subscribe to a newsletter. |
| payment_model | plainText, GpgCreditCard | The name of the payment model. |
| record_option | plainText, TRUE/FALSE | When true, the form displays additional fields that allow making a donation as an Honorarium or a Memoriam. |
| top_information | html | Basic HTML that is displayed in the "Making a Donation" sidebar. |
Bravehearts
The table shows the various options available in the Braveheart model.
| field_name | type | description |
|---|---|---|
| banner_urls | URL list | Comma separated list of URLs. These should be listed in the order you wish them to be displayed. |
| categories | plainText list | Comma separated list of categories. These should be listed in the order you wish them to be displayed. |
| category_descriptions | html | Basic HTML description of the categories. |
| contact_name | plainText | Contact peron's name. |
| contact_email | Contact email address. | |
| contact_telephone | telephone | Contact telephone number |
| deadline | date, month/day/year | The date deadline that the nomination is due by. |
| info_link | url | URL to page with additional information |
| logo_url | url | URL to a correctly sized logo image |
| introduction | html | Basic HTML used as the nomination introduction. |
| mailto | email, list | Comma separated list of email addresses to receive notification. |
| presentation_date | date, month/day/year | The specific date of the award presentation event. |
| printable_link | url | URL to a printable nomination form. |
| process | html | Basic HTML description of the process of nomination. |
| purpose | html | Basic HTML description of the purpose of nomination. |
| reason_intro | html | Basic HTML used as the nominating reason text. |
| sponsor_text | html | Basic HTML used as the sponsor acknowledgment. |
| tagline | html | Basic HTML used as the nomination tag line. |
| year | numeric | The year for which the form is applicable. |
RealHero
The table shows the various options available in the RealHero model.
| field_name | type | description |
|---|---|---|
| banner_urls | URL list | Comma separated list of URLs. These should be listed in the order you wish them to be displayed. |
| categories | plainText list | Comma separated list of categories. These should be listed in the order you wish them to be displayed. |
| category_descriptions | html | Basic HTML description of the categories. |
| contact_email | Contact email address. | |
| contact_telephone | telephone | Contact telephone number |
| deadline | date, month/day/year | The date deadline that the nomination is due by. |
| info_link | url | URL to page with additional information |
| introduction | html | Basic HTML used as the nomination introduction. |
| mailto | email, list | Comma separated list of email addresses to receive notification. |
| presentation_date | date, month/day/year | The specific date of the award presentation event. |
| printable_link | url | URL to a printable nomination form. |
| process | html | Basic HTML description of the process of nomination. |
| purpose | html | Basic HTML description of the purpose of nomination. |
| reason_intro | html | Basic HTML used as the nominating reason text. |
| sponsor_text | html | Basic HTML used as the sponsor acknowledgment. |
| tagline | html | Basic HTML used as the nomination tag line. |
| year | numeric | The year for which the form is applicable. |
Intake
The table shows the various options available in the Intake model.
| field_name | type | description |
|---|---|---|
| admin_emails | plainText list | Comma separated list of emails. Used to send admin notifications such as purge notification. |
| notify | plainText TRUE/FALSE | Shall the system send out notification of Intakes? Takes the values of TRUE or FALSE. |
| notify_emails | html | Comma separated list of emails. All listed addresses will receive Intake notification. |
| notify_frequency | plainText | How often to send out notifications. Format should be a number and then a time identifier.(y=year, m=month, w=week, d=day, h=hour, i=minute, s=second). Example: 24 h |
| notify_day_start | plainText | The hour upon which the notification period starts. Must be in 24 hour notation. Notification emails will include all new Intakes from the current period unless the frequency is set below 24 h. Example: 17:00 |
| purge | plainText TRUE/FALSE | Shall the system automatically purge old Intakes? Takes the values of TRUE or FALSE. |
| purge_frequency | plainText | How often to purge old Intakes. An email will be sent to the admin_emails 24 h prior to purge. Format should be a number and then a time identifier.(y=year, m=month, w=week, d=day, h=hour, i=minute, s=second). Example: 60 d |
