Overview

Namespaces

  • momentphp
    • exceptions
    • interfaces
    • middlewares
    • providers
    • traits
  • None

Classes

  • App
  • Bundle
  • Cache
  • CallableResolver
  • Config
  • Controller
  • Database
  • DebugInfo
  • Error
  • ExceptionHandler
  • FlashMessages
  • Helper
  • Log
  • Middleware
  • Model
  • ObjectCache
  • Provider
  • Registry
  • Router
  • Settings
  • SmartyViewEngine
  • Template
  • TwigViewEngine
  • View
  • Overview
  • Namespace
  • Class

Class Controller

Controller

momentphp\Controller uses momentphp\traits\ContainerTrait, momentphp\traits\OptionsTrait, momentphp\traits\ClassTrait
Abstract
Namespace: momentphp
Located at Controller.php
Methods summary
public
# __construct( Interop\Container\ContainerInterface $container, array $options = [] )

Constructor

Constructor

Parameters

$container
$options
public array
# implementedEvents( )

Return a list of all events that will fire in the controller during its lifecycle

Return a list of all events that will fire in the controller during its lifecycle

Returns

array
public
# initialize( )

Callback called after controller creation

Callback called after controller creation

public
# beforeAction( string $action )

Callback called before the controller action

Callback called before the controller action

Parameters

$action
public
# afterAction( string $action )

Callback called after the controller action

Callback called after the controller action

Parameters

$action
public Psr\Http\Message\ResponseInterface
# render( null|string $template = null, null|string $bundle = null )

Return response object with rendered template

Return response object with rendered template

Parameters

$template
$bundle

Returns

Psr\Http\Message\ResponseInterface
public momentphp\View
# set( mixed $name, mixed $value = null )

Save a variable or an associative array of variables for use inside a template

Save a variable or an associative array of variables for use inside a template

Parameters

$name
$value

Returns

momentphp\View
public
# abort( null|Psr\Http\Message\RequestInterface $request = null, null|Psr\Http\Message\ResponseInterface $response = null )

Not found helper

Not found helper

Parameters

$request
$response
public string|Psr\Http\Message\ResponseInterface
# __call( string $action, array $args = [], array $options,… )

Invoke action

Invoke action

Parameters

$action
$args
$options,…

Returns

string|Psr\Http\Message\ResponseInterface
public momentphp\Model|momentphp\Registry
# __get( string $name )

Return model

Return model

Parameters

$name

Returns

momentphp\Model|momentphp\Registry
Methods used from momentphp\traits\ContainerTrait
container()
Methods used from momentphp\traits\OptionsTrait
options()
Methods used from momentphp\traits\ClassTrait
classBasename(), classConfigKey(), classNamespace(), classPart(), classPath(), classPrefix(), classSuffix()
Properties summary
protected Psr\Http\Message\RequestInterface $request

Request

Request

#
protected Psr\Http\Message\ResponseInterface $response

Response

Response

#
protected momentphp\View $view

View

View

#
Properties used from momentphp\traits\ContainerTrait
$app, $container
Properties used from momentphp\traits\OptionsTrait
$options, $optionsInitialized
MomentPHP API documentation generated by ApiGen