Sha256: 443ff68dbfc7e6b12d1bd8c94356e7af5af6721f598a17872049f5fbb2eedf51

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

#:nodoc:
module Zen
  #:nodoc:
  module Controllers
    ##
    # The BaseController is extended by both the FrontendController and the 
    # BackendController. This controller is mostly used to set and retrieve data that's 
    # used in both the backend and the frontend.
    #
    # @author Yorick Peterse
    # @since  0.1
    #
    class BaseController < Ramaze::Controller
      include ::Zen::Language

      helper :csrf, :cgi
      
      ##
      # The initialize method is called upon class initalization and is used to 
      # process several items before loading the controller(s) for the current module.
      #
      # @author Yorick Peterse
      # @since  1.0
      #
      def initialize
        super
        
        # Get all settings
        if !@settings
          @settings = ::Settings::Models::Setting.get_settings
        end
        
        # Override the language
        ::Zen::Language.options.language = @settings[:language]
        ::Zen::Language.load('zen_general')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zen-0.2.4.1 lib/zen/controller/base_controller.rb
zen-0.2.4 lib/zen/controller/base_controller.rb
zen-0.2.3 lib/zen/controller/base_controller.rb
zen-0.2 lib/zen/controller/base_controller.rb