The super class of dynamic element classes.
Dynamic elements convert themselves to HTML. These are very important in development with CGIKit.
CKElement returns HTML when to_s() is called. In components development, you bind elements to component’s methods. At runtime, the binding is executed by run(). These two methods are expected to be overrided in the subclasses of CKElement.
CKElement objects, including components, are usually instantiated by CKElement.instance. This method loads elements/components and creates element objects. In this method, some paths are searched to require files.
The searched paths:
The latter two paths are for extention elements or components. It is recommended that your own elements or components are installed in the 1st path.
If you create custom elements, the class of the custom elements must inherit CKElement. Simple dynamic element can be created only by overriding to_s(). to_s() is called when CGIKit converts the dynamic elements to HTML. If you add new attributes to your custom elements, run() must be overrided.
Internal method that will be overridden in subclasses.
Return an array of names of the element’s own attributes. The value is used to generate optional HTML attributes. Subclasses must override this method.
Return a definition hash of the element.
Calls block once for each attributes in definition passing the key and value as parameters.
Returns the element ID.
Fetches the result of the parent component’s methods. When is_binding is true, fetch() returns String without binding from .
Return a definition name of the element with the class name.
Return a string of values of optional attributes with "other" attribute string excepting the element’s own attributes.
Internal method. This method will be overridden in subclasses.
Returns true if the element is a top level.