Powered by SmartDoc

CKComponent

You can use one component in another component like elements. It means that it is possible to nest components with specifying in binding files.

OtherComponent : MainPage {}

Components has no attributes like elements. Instead of this, components' instance variables are as attributes.

class MainPage < CKComponent
  attr_accessor :title
end
OtherComponent : MainPage {
  title = "Example for CKComponent";
}

MainPage component's titleattribute is substituted "Example for CKComponent".

CKPartsMaker

You can write a component which converts itself to a part of a web page. In some cases, a web page is composed of these components. These components are called parts component. Parts componente is recommended to include CKPartsMaker. A component which includes CKPartsMaker isn't displayed even if its name is set to the CKApplication#target.

A name of parts component is recommended to have "Parts" or gComponenth at the end of the name to distinguish it from page component.

Object attributes of CKPartsMaker module
Object attribute Description
substitute_page When CGIKit recieves requests to show component parts, CGIKit shows the page specified by this attribute. A main page of an application is displayed when the value is not defined.