Sha256: 613cfcac84601712002ce0d6bc00f001db964707e29a5c1e91de5e74a87b8d57

Contents?: true

Size: 1.01 KB

Versions: 51

Compression:

Stored size: 1.01 KB

Contents

require 'spiderfw/controller/controller'
require 'spiderfw/controller/mixins/visual'

module Spider

    class PageController < Controller
        include Visual
        include WidgetHelper
        include HTTPMixin
        include StaticContent

        def initialize(request, response, scene=nil)
            super
            @widgets = {}
        end
        
        
        def get_route(path)
            if (path =~ /^[^:]+:([^:\/]+)[:\/]?(.*)$/) # route to widgets
                if (@widgets[$1])
                    return Route.new(:path => path, :dest => @widgets[$1], :action => $2)
                end
            elsif (path =~ /_h\/(.+)/) # Route back to home
                return Route.new(:path => path, :dest => Spider::HomeController, :action => $1)
            end
            return super
        end
        
        # 
        # def render(path=nil, scene=nil)
        #     scene ||= @scene
        #     scene[:widgets] = @widgets
        #     super(path, scene)
        # end
        # 



    end


end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
spiderfw-0.6.21 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.20 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.19 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.18 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.17 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.16 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.15 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.14 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.13 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.12 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.11 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.10 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.9 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.8 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.7 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.6 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.5 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.4 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.3 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.2 lib/spiderfw/controller/page_controller.rb