Public Member Functions | |
__call ($name, $args) | |
Implements dynamic function calls for, e.g., setXxx(). | |
__clone () | |
Clones this component and subcomponents for reuse. | |
__construct () | |
INSERT BRIEF DESCRIPTION HERE. | |
add ($component, $slot="", $params=array()) | |
Adds a component to this container. | |
addText ($txt, $params=array()) | |
Add text element to container. | |
addTextTo ($slot, $txt, $params=array()) | |
Add text element to a specific slot of a container. | |
Public Attributes | |
const | SLOT_ACCESS_PRIVATE |
Slot is private (components can only be added from within the class). | |
const | SLOT_ACCESS_PUBLIC |
Slot is public (components can be added to it from outside class). | |
const | SLOT_SIZE_MULTI |
Slot can have any number of components in it. | |
const | SLOT_SIZE_SINGLE |
Slot can only have one component in it. | |
Static Public Attributes | |
static | $ENABLE_ADD_CHECKS |
If true, check to make sure that adding a component doesn't violate slot options. |
A container is a component that is inteded to contain other components in some way. It must render those components and also do any rendering for itself.
public
, TKComponent
, multi
]: default slot
TKContainer::__construct | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Reimplemented from TKComponent.
Reimplemented in TKBorderPanel, TKHBox, TKNullBox, TKScrollPane, TKTree, and TKVBox.
TKContainer::__call | ( | $ | name, | |
$ | args | |||
) |
Implements dynamic function calls for, e.g., setXxx().
This method allows you to call, e.g., setStyle(...)
instead of set('style', ...)
. See the main documentation for this class for more on the dynamic functions.
This method implements setXxx(), getXxx(), appendXxx() and existsXxx() corresponding to set(), get(), append(), exists().
$name | [string]: name of method | |
$args | [array]: arguments to method |
Reimplemented from TKComponent.
TKContainer::__clone | ( | ) |
Clones this component and subcomponents for reuse.
Once a component has been rendered, it is not safe to re-use the HTML generated because it may contain unique IDs, events, etc. This method attempts to clone this component so that it can be reused with its configuration. It is NOT safe for use at the moment because of many sticky details in properly cloning components and espcially containers.
Reimplemented from TKComponent.
TKContainer::add | ( | $ | component, | |
$ | slot = "" , |
|||
$ | params = array() | |||
) |
Adds a component to this container.
With only one parameter, this function adds the specified component to the default slot (usually 'main'). The slot can also be specified, and additional parameters can be given as the third argument. The meaning of these parameters depends on the container, so see the appropriate documentation for that container.
There is a shorthand way to add components. One can use the addXxx()
syntax or addXxxTo()
, where Xxx
is a class name without the leading TK
. For example: addLabel()
or addLabelTo()
. The syntax without "-To" creates an object of type Xxx and calls its constructor with all of the arguments given to addXxx(). The syntax with "-To" takes as its first argument the name of the slot to add the component to. The remaining arguments are passed to the component's constructor.
$component | [TKComponent]: object to add to this container | |
$slot | [string]: name of slot to add object to | |
$params | [array]: additional parameters |
TKContainer::addText | ( | $ | txt, | |
$ | params = array() | |||
) |
Add text element to container.
A text element is a lightweight replacement for a label that doesn't actually create a full scale component. Use it instead of TKLabel when you are adding plain text or HTML.
$txt | [string]: text to add | |
$params | [array]: additionally parameters |
TKContainer::addTextTo | ( | $ | slot, | |
$ | txt, | |||
$ | params = array() | |||
) |
Add text element to a specific slot of a container.
A text element is a lightweight replacement for a label that doesn't actually create a full scale component. Use it instead of TKLabel when you are adding plain text or HTML.
$slot | [string]: slot to add text to | |
$txt | [string]: text to add | |
$params | [array]: additionally parameters |