Element is a framework which shows Ruby's objects/methods as HTML. To use elements is the core of CGIKit development.
Because component is also one type of elements, components can be nested. As a result of it, the web page is formed by some components and elements. In this case, the top-level component usually determines the layout of the web page, other components and elements gives the top-level component their result of HTML conversion.
Element has attributes which determine its behavior. By binding these attributes to Ruby's objects and methods, the objects are embeded in the outputed HTML. Because Ruby objects are accessed through Ruby's method, all the subjects to bind are ckd's literal or Ruby's methods.
Currently, there are 19 types of elements. CKString is used the most frequently. This element simply shows the result of its binding. Other than CKString, there are varied elements. For example, CKConditional controls the display of its content. CKRepetition shows its content repeatedly by iterating "list
" attribute. Here, we introduce some elements briefly. The detail is available as "Dynamic Elements".
Element | Description |
---|---|
CKString | Shows the result of binding simply. |
CKHyperlink | Links to other component or normal URL. |
CKImage | Shows an image in resource directory. |
Element | Description |
---|---|
CKConditional | Decides whether the element shows its content by the result of binding. |
CKRepetition | Repeats its content. |
Element | Description |
---|---|
CKForm | Shows a HTML form. The form data is assigned to a component through bound methods. |
CKTextField | Shows a textfield. |
CKRadioButton | Shows a radiobutton. |
CKCheckbox | Shows a checkbox. |
CKPopUpButton | Shows a pop-up button. |
CKText | Shows a textarea. |
CKBrowser | Shows a list where you can select multiple items. |
CKFileUpload | Shows a file-upload field. |
CKSubmitButton | Shows a submit-button. |
CKResetButton | Shows a reset-button. |
Element | Description |
---|---|
CKFrame | Sets components in frame. |
CKComponent | Locates elements or components in itself. |
CKContent | Shows the grandparent's content. |
CKGenericElement | Generates a generic HTML tag. |