module KingForm
module Builder
# Subclass of the KingFormBuilder for forms/fields wrapped inside a Definition List dl>dt,dd.
# This class just overides the nessessary html wrapping function of the KingFormBuilder.
#
# ====Example haml
# - dl_form_for(current_object) do |f|
# = f.section _('legend.user.details') do
# = f.text :first_name
# = f.text :last_name
#
# => #
#
class DefinitionList < KingForm::Builder::Base
# Create a section(fieldset) within a form
# A section is a group of related object information with name/value pairs,
# like all dates of an object or the users name fields(last/first/title/nick).
#
# A section html consists of a fieldset > legend > dl > dt > dd
# The dt holds the title/description (DefinitionType) of the current field
# The dd holds the value.
# This wrapup is preferred over ul/li or other listing types because of
# the semantic meaning of the html
#
#===Example haml
# = f.section _('legend.user.details') do
# = f.text :first_name
# = f.text :last_name
#
# => #
#
# = f.section 'User', :class=>'settings', :dl=>{:class=>'left'}
#
# => #