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-1.0.1 lib/spiderfw/controller/page_controller.rb
spiderfw-1.0.0 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.39 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.38 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.37 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.35 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.34 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.33 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.32 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.31 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.30 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.29 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.28 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.27 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.26 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.26.pre1 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.25 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.24 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.23 lib/spiderfw/controller/page_controller.rb
spiderfw-0.6.22 lib/spiderfw/controller/page_controller.rb