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

  • B
  • H2
  • H3
  • H4
  • H5
  • H6
  • I
  • LineBreak
  • P
  • Template
  • TT
  • UL
  • URL
  • Variable

Class Template

Captures and formats templates (variable content placeholders) by delegating rendering to external handlers.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Formatter\Driver\coreuimarkup\Token
Extended by Core\Formatter\Driver\coreuimarkup\Token\Template
Namespace: Core\Formatter\Driver\coreuimarkup\Token
Package: CoreUI\Markup\Token
Since: 3.1
Requires: PHP 5.3
Version: 1.0
Located at Formatter/Driver/coreuimarkup/Token/Template.inc.php

Methods summary

public
# __construct( Core\Formatter $formatter )

Initialises template token instance.

Initialises template token instance.

Parameters

$formatter
Reference to the formatter instance that initialises the token.

Since

3.1

Overrides

Core\Formatter\Driver\coreuimarkup\Token::__construct
public string[]
# captures( )

Returns a hash of regular expressions and handlers processed by this token instance.

Returns a hash of regular expressions and handlers processed by this token instance.

Returns

string[]

Hash with regular expressions as keys and their handlers as values. A handler is a hash with unique capture names as keys and their corresponding callbacks to handle the capture as values. Regular expressions must use named captures that match the handler hash keys.

Since

3.1
public string
# format( string $template )

Formats a captured template.

Formats a captured template.

Parameters

$template
Name of template to format.

Returns

string

Since

3.1
public string
# handleCapture( string $key, string $fragment, array $match )

Formats markup parser captures.

Formats markup parser captures.

Parameters

$key
Key of capture token.
$fragment
Captured text fragment.
$match
Hash of match captures.

Returns

string
Formatted text fragment.

Since

3.1
public
# registerTemplate( string $template, callable $callback )

Registers a new handler for a template. An existing handler for the given template is replaced with the new one.

Registers a new handler for a template. An existing handler for the given template is replaced with the new one.

Parameters

$template
Template identifier to register handler for.
$callback
Callback to invoke on registered template.

Returns


$this Reference to this instance.

Since

3.1
public
# registerTemplates( array $templates )

Registers a set of new template handlers. Any already existing handler for a given template is replaced with the new one.

Registers a set of new template handlers. Any already existing handler for a given template is replaced with the new one.

Parameters

$templates

Dictionary of template identifiers as keys with their corresponding callbacks as values to register.

Returns


$this Reference to this instance.

Since

3.1
public
# setDefaultHandler( callable $callback )

Sets the default template handler.

Sets the default template handler.

Parameters

$callback
Callback to invoke on non-registered templates.

Returns


$this Reference to this instance.

Since

3.1

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), 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 callable $_v_defaultHandler

Default handler invoked if no specific handler for a captured template is registered.

Default handler invoked if no specific handler for a captured template is registered.

Since

3.1
#
protected array $_v_templates

Dictionary of registered templates as keys and their associated callbacks as values.

Dictionary of registered templates as keys and their associated callbacks as values.

Since

3.1
# array ()

Properties inherited from Core\Formatter\Driver\coreuimarkup\Token

$_v_formatter

Magic properties

public read-only callable $defaultHandler

Default handler invoked if no specific handler for a captured template is registered.

public read-only array $templates

Dictionary of registered templates as keys and their associated callbacks as values.

Magic properties inherited from Core\Formatter\Driver\coreuimarkup\Token

$formatter

Magic properties inherited from Core\Object

$hash, $uuid

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