Class | Ramaze::Controller |
In: |
lib/ramaze/controller.rb
|
Parent: | Object |
Ramaze::Controller is the base controller of all controllers when developing applications in Ramaze. It acts as a nice wrapper around Innate::Node and allows for a more traditional MVC approach.
@example An example controller
class Posts < Ramaze::Controller map '/posts' def index end end
@author Michael Fellinger @since 04-01-2009
CONTROLLER_LIST | = | Set.new | ||
IRREGULAR_MAPPING | = | { 'Controller' => nil, 'MainController' => '/' |
Hash containing the names of two common controller names and the URIs they
should be mapped to.
@author Michael Fellinger @since 04-01-2009 |
Returns the application to which the controller belongs to.
@author Michael Fellinger @since 04-01-2009 @return [Ramaze::App]
Generates a URI for the full namespace of a class. If a class is named A::B::C the URI would be /a/b/c.
@author Michael Fellinger @since 04-01-2009 @param [String] klass_name The name of the class for which to generate
the mapping, defaults to the current class.
@return [String]
Modifies the extending class so that it‘s properly set up to be used as a controller.
@author Michael Fellinger @since 04-01-2009 @param [Class] into The class that extended Ramaze::Controller (or a sub
class).
Maps the current class to the specified location.
@author Michael Fellinger @since 04-01-2009 @param [String] location The URI to map the controller to. @param [String] app_name The name of the application the controller
belongs to.
Returns the URI a controller is mapped to.
@author Michael Fellinger @since 04-01-2009 @return [String]
Returns all the options for the application the controller belongs to.
@author Michael Fellinger @since 04-01-2009 @return [Innate::Options]
Sets all the controllers up and loads a default controller in case no custom ones have been specified.
@author Michael Fellinger @since 04-01-2009
Method that‘s used to setup each controller, called by Ramaze::Controller.setup.
@author Michael Fellinger @since 04-01-2009