Method: SWS::ImageButton#generate_html
- Defined in:
- lib/sws/Core/components/ImageButton/ImageButton.rb
#generate_html ⇒ Object
Generates HTML output containing <INPUT type=“submit” tag
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/sws/Core/components/ImageButton/ImageButton.rb', line 51 def generate_html () string = "<INPUT TYPE=\"image\" NAME=\"#{element_name()}\" VALUE=\"#{@slots["value"].value}\"#{generic_attr_string()}" if ( slot_bound?( "resource" ) ) framework = slot_bound?("framework") ? @slots["framework"].value : "app" src = app().adaptor.base_path() + app().resource_request_handler_key + "/" + framework + "/" + @slots["resource"].value elsif ( slot_bound?("src") ) src = @slots["src"].value() end string << " src=\"#{src}\"" ["alt", "title"].each do |attr| if ( slot_bound?(attr) ) string << " #{@slots[attr].to_tag_attribute}" end end string << ">" return string end |