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

  • Authentication
  • Authentication_Token
  • AutoLoader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Configuration
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • Version

Class Dispatcher

A Dispatcher is responsible for delegating control to the controller action as specified by the request.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Dispatcher
Namespace: Core
Package: Core\Dispatcher
Since: 3.0
Requires: PHP 5.3
Version: 1.0
Located at Dispatcher.inc.php

Methods summary

public
# __construct( Core\URI $uri )

Parameters

$uri
Configuration URI.

Since

3.0
protected string|array
# _translateName( string $name, string $delimiter = null )

Transforms a request action string into an action name.

Transforms a request action string into an action name.

Parameters

$name
Action string to transform.
$delimiter
Delimiter added between extracted action name components.

Returns

string|array

Action name components array or string of action name, if a delimiter is provided.

Since

3.0
public static Core\Dispatcher
# autocreate( Core\URI $uri )

Driver factory.

Driver factory.

Parameters

$uri
Driver configuration URI.

Returns

Core\Dispatcher

Since

3.0
public Core\Controller
# dispatch( string $controllerString, string $actionString )

Dispatches control to the given controller and action strings. Also sets the internal controller and action properties to the translated controller and action names.

Dispatches control to the given controller and action strings. Also sets the internal controller and action properties to the translated controller and action names.

Parameters

$controllerString
Controller string from request.
$actionString
Action string from request.

Returns

Core\Controller
Instance of invoked controller.

Throws

Core\Exception\BadMethodCall
Controller has no matching action method defined.
Core\Exception\Loader

Remark

The default controller name is "index", the default action name is "main". Both are used, when a controller or action is not defined, respectively.

If the requested controller does not exist, the fallback controller is used instead (if configured).


Since

3.0
public
# execute( )

Parses the initial query, propagates $_GET and dispatches the requested action. This method is executed by the primary controller.

Parses the initial query, propagates $_GET and dispatches the requested action. This method is executed by the primary controller.

See

Core\Controller\Primary

Since

3.0
public
# setArgs( array $arguments )

Overwrites arguments. This is useful to overwrite standard parameters that do not change often, such as the current language in use. Other uses are strongly discouraged.

Overwrites arguments. This is useful to overwrite standard parameters that do not change often, such as the current language in use. Other uses are strongly discouraged.

Parameters

$arguments
Associative key-value array of arguments to set or overwrite.

Returns


$this

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

string FallbackParameter

Sets the name of a standard fallback controller. Defaults to null.

Sets the name of a standard fallback controller. Defaults to null.

Since

3.0
# 'fallback'
string TargetGroupParameter

Defines the target group for dispatcher commands. Defaults to "Application\Controller".

Defines the target group for dispatcher commands. Defaults to "Application\Controller".

Since

3.0
# 'target-group'

Constants inherited from Core\Object

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

Properties summary

protected array $_v_args

Associative array of command arguments.

Associative array of command arguments.

Since

3.0
#
protected string $_v_currentAction

Current action name.

Current action name.

Since

3.0
#
protected string $_v_currentController

Current controller name.

Current controller name.

Since

3.0
#
protected array $_v_parameters

Parsed configuration parameters.

Parsed configuration parameters.

Since

3.0
#

Magic properties

public read-only array $args

Associative array of execution arguments.

public read-only string $currentAction

Name of current action.

public read-only string $currentController

Name of current controller.

public read-only array $parameters

Associative array of parsed configuration parameters.

Magic properties inherited from Core\Object

$hash, $uuid

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