xplo.re Medusa Core Framework 3.2
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
      • Driver
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Fault
      • Formatter
        • Driver
      • Incident
        • Exception
      • Reporter
        • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • Type
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Control
  • Element

Interfaces

  • Dynamo

Class Control

Controls are composite objects that contain of several elements that are managed by the control. Additionally it offers standard methods and properties that are also available for elements such that both can be used in several CoreUI API method calls.

Controls feature an own set of attributes that change the behaviour of the control. Each attribute features a setter method. Controls must return the a reference to their instance from setter methods to allow chained method calls.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\View\Driver\coreui\Control implements Core\Configurable

Direct known subclasses

Core\View\Driver\coreui\Control\Button, Core\View\Driver\coreui\Control\Dialog, Core\View\Driver\coreui\Control\Table

Indirect known subclasses

Core\View\Driver\coreui\Control\Button\Navigate, Core\View\Driver\coreui\Control\Button\Submit, Core\View\Driver\coreui\Control\Table\Listing

Abstract
Namespace: Core\View\Driver\coreui
Package: CoreUI\Control
Since: 3.1
Requires: PHP 5.3
Version: 1.1
Located at View/Driver/coreui/Control.inc.php

Methods summary

public
# __clone( )

Creates deep clones of properties and resets the ID attribute.

Creates deep clones of properties and resets the ID attribute.

Since

3.1
protected
# __construct( Core\View\Driver\coreui $proxy, array $options = null )

Parameters

$proxy
CoreUI proxy instance that created this element instance.
$options

Associative key-value array of options to set. Equals a call to the Core\View\Driver\coreui\Control::setOptions() method after constructing a new instance.

Since

3.1
public string
# __toString( )

Renders the HTML code for the control.

Renders the HTML code for the control.

Returns

string

Remark

The default implementation trigger a user error if a derived class does not implement this method.


Overrides

Core\Object::__toString
protected Core\Translation\Language_Node|string
# _T( string $key, string $default = null )

Loads the specified entry from the associated translator interface.

Loads the specified entry from the associated translator interface.

Parameters

$key
Key of language file entry to load.
$default

Default string to use if no such language file exists. If set to null, and no translator interface is registered, the string "[key]" is returned instead.

Returns

Core\Translation\Language_Node|string

Language file entry object or default value, if language entry does not exist.

Since

3.1
public static Core\View\Driver\coreui\Control
# derive( Core\View\Driver\coreui $proxy, string $className, array $id_ = null, array $options = null )

Control factory.

Control factory.

Parameters

$proxy
CoreUI proxy instance that creates the new control.
$className

Name of control base class. Usually, module notion is used. Can be relative to the namespace of the called class or absolute. A full class name (with namespace hierarchy) can also be used.

$id_

$options Associative array of options to set for the new control.

$options

Returns

Core\View\Driver\coreui\Control

Throws

Core\Exception\InvalidClassName
Failed to resolve class name to CoreUI control module.

Since

3.1
public string
# id( )

Returns an automatically assigned ID for the control. The ID is generated on first request and buffered by the control. An ID is unique per instance and automatically reset if a control is cloned.

Returns an automatically assigned ID for the control. The ID is generated on first request and buffered by the control. An ID is unique per instance and automatically reset if a control is cloned.

If the ID of a control is required but accessed for the first time after the control was rendered, the rendered control does not have an ID set. In that case call this method before rendering the control.

Since a control is a composite object, the ID is usually from the central or topmost element of the control or for dynamo controls the ID of the control set key.

Returns

string
ID of control (or central element by the control).

Since

3.1
public
# on( string $event, string $action )

Attaches an event handler to the control. The event is attached to the actual element whose ID is returned by the Core\View\Driver\coreui\Control::id() method.

Attaches an event handler to the control. The event is attached to the actual element whose ID is returned by the Core\View\Driver\coreui\Control::id() method.

Parameters

$event
Name of event to attach event handler to (without "on" prefix).
$action

JavaScript code block to handle event. The code will be put inside a function with a single argument e that represents the event.

Returns


$this

Since

3.1
public
# setOption( string $key, mixed $value )

Sets a control option. Invokes the corresponding setKey() method of the control.

Sets a control option. Invokes the corresponding setKey() method of the control.

Parameters

$key
Name of option to set.
$value
New value of option to set.

Returns


$this

Throws

Core\Exception\UndefinedKey
Option not supported by control.

Since

3.1

Implementation of

Core\Configurable::setOption()
public
# setOptions( array $options = null )

Sets multiple control options. Invokes the corresponding setKey() method of the control for each option to set.

Sets multiple control options. Invokes the corresponding setKey() method of the control for each option to set.

Parameters

$options
Associative key-value array of options to set.

Returns


$this

Throws

Core\Exception\UndefinedKey
Option not supported by control.

Since

3.1

Implementation of

Core\Configurable::setOptions()
public
# setTitle( string $title )

Sets the title for the control.

Sets the title for the control.

Parameters

$title
New title for control to set.

Returns


$this

Since

3.1
public
# setTranslator( Core\Translation $translator )

Sets the translator interface for the instance.

Sets the translator interface for the instance.

Parameters

$translator
Translator instance to set for control.

Returns


$this

Since

3.1

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected Core\Hash $_v_options

Hash of control options.

Hash of control options.

Since

3.1
#
protected Core\View\Driver\coreui $_v_proxy

CoreUI proxy driver instance.

CoreUI proxy driver instance.

Since

3.1
#
protected Core\Translation $_v_translator

Buffered translator instance from parent CoreUI proxy.

Buffered translator instance from parent CoreUI proxy.

Since

3.1
#
protected string $_id

Buffered ID of control, automatically generated by the Core\View\Driver\coreui\Control::id() method. Set on first request.

Buffered ID of control, automatically generated by the Core\View\Driver\coreui\Control::id() method. Set on first request.

Since

3.1
#

Magic properties

public read-only string $id

Automatically assigned ID for the control.

public read-only Core\Hash $options

Hash of control options.

public read-only Core\View\Driver\coreui $proxy

CoreUI proxy driver instance.

public read-only Core\Translation $translator

Translator instance from parent CoreUI proxy.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.2 API documentation generated by ApiGen