Block Form

Categories

Component ID

2636986

Component name

Block Form

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Phase I

Create module which provides new block with static text and form. The static text value should sit in a variable defaulted to "Hi visitor". The form should contain two text fields "First name" and "Last name" and one checkbox "Show in bold". When one submits form system message "Welcome to Drupal, [first name] [last name]!" should appear. If checkbox is checked message should be bolded.

First and last names may contain only alphabetical chars, space, dash (-) and apostrophe (‘).


Phase II

a. Each time visitor enters name save it to database. For new ones add record with counter 1. For returning (same first/last name) update record: increase counter by one.

Hint: you should create schema in .install file of the module.

b. Create a block view (using Views module) which shows visitors statistics:

First Name | Last Name | Counter Value.

Hint: you should use views API to define your new table.