Module: Hanami::Helpers::HtmlHelper
- Included in:
- LinkToHelper
- Defined in:
- gems/gems/hanami-helpers-1.3.1/lib/hanami/helpers/html_helper.rb,
gems/gems/hanami-helpers-1.3.1/lib/hanami/helpers/html_helper/html_node.rb,
gems/gems/hanami-helpers-1.3.1/lib/hanami/helpers/html_helper/text_node.rb,
gems/gems/hanami-helpers-1.3.1/lib/hanami/helpers/html_helper/html_builder.rb,
gems/gems/hanami-helpers-1.3.1/lib/hanami/helpers/html_helper/html_fragment.rb,
gems/gems/hanami-helpers-1.3.1/lib/hanami/helpers/html_helper/empty_html_node.rb,
gems/gems/hanami-helpers-1.3.3/lib/hanami/helpers/html_helper.rb,
gems/gems/hanami-helpers-1.3.3/lib/hanami/helpers/html_helper/html_node.rb,
gems/gems/hanami-helpers-1.3.3/lib/hanami/helpers/html_helper/text_node.rb,
gems/gems/hanami-helpers-1.3.3/lib/hanami/helpers/html_helper/html_builder.rb,
gems/gems/hanami-helpers-1.3.3/lib/hanami/helpers/html_helper/html_fragment.rb,
gems/gems/hanami-helpers-1.3.3/lib/hanami/helpers/html_helper/empty_html_node.rb
Overview
HTML builder
By including Hanami::Helpers::HtmlHelper
it will inject one private method: html
. This is a HTML5 markup builder.
Features:
-
Support for complex markup without the need of concatenation
-
Auto closing HTML5 tags
-
Custom tags
-
Content tag auto escape (XSS protection)
-
Support for view local variables
Usage:
-
It knows how to close tags according to HTML5 spec (1)
-
It accepts content as first argument (2)
-
It accepts another builder as first argument (3)
-
It accepts content as block which returns a string (4)
-
It accepts content as a block with nested markup builders (5)
-
It builds attributes from given hash (6)
-
It combines attributes and block (7)