When you define your component, its class must inherit CKComponent in code file. The component dynamically renders HTML with template and binding file.
A component has 3 files in a directory whose name is the same as the component’s name. These three files composite Model-View-Controller architecture.
Template(View): | A HTML file includes CGIKit tags ( <cgikit> ). One CGIKit tag corresponds to one dynamic element. |
Binding(Controller): | A definition file for elements is used by a component. The suffix, ckd, is abbreviation of "CGIKit Definition". The definition file connects Template to Code. |
Code(Model): | A Ruby source where a component’s class is defined. It must inherit CKComponent. The name of the component’s class must be the same as the component name. |
ex) An application with a MainPage component
/cgi-bin/cgikit-app cgikit-app.cgi /MainPage MainPage.html MainPage.ckd MainPage.rb
access_instance_variables?
convert_char_code
definition_file
definition_string
init
new
page
parse_ckd_value
post_action
pre_action
request
resource_manager
response
run
session
template_file
template_string
to_s
variable?
Class CKComponent::FileNotFoundError
Enables accessing instance variables directly with value(), take_value().
Hook method to convert character code for the form values.
Returns name of the definition( binding ) file.
Returns body of the definition( binding ) file as string.
Hook method for initialization instead of initialize(). Form data is not setted when the method is called.
Creates a specified page component.
Internal method.
Hook method called after run() that are setting form data and invoking action.
Hook method called after setting form data, before invoking action.
Returns a request object of the application.
Returns a resource manager object.
Returns a response object of the application.
Invokes the action after binding component’s variables to attributes for definitions, values from request to component’s variables.
Returns the session object. If the session isn’t existed, returns a new session.
Returns name of the template file.
Returns body of the template file as string.
Converts the component to HTML.
Internal method.