Method: SWS::Image#generate_html

Defined in:
lib/sws/Core/components/Image/Image.rb

#generate_htmlObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/sws/Core/components/Image/Image.rb', line 22

def generate_html ()

  string = "<IMG"
  
  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 << generic_attr_string() << ">"

  return string

end