2.3. Naming of component

A component can be named by the argument of the s2component method. A component name is specified as a character string or a symbol.

require 's2container'

class Action
  s2comp :name => :act
end

p s2app.get(:act)   # getting a component by name
p s2app[Action]     # getting a component by class
[Note]NOTE

This Example is located at "examples/quickstart/quickstart2".



© Copyright The Seasar Foundation and the others 2008-2009, all rights reserved.