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 View

View

momentphp\View uses momentphp\traits\ContainerTrait
Namespace: momentphp
Located at View.php
Methods summary
public
# __construct( Interop\Container\ContainerInterface $container, array $engine, string $engine,… )

Constructor

Constructor

Parameters

$container
$engine
$options
$engine,…
public
# 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


$this
public momentphp\interfaces\ViewEngineInterface
# viewEngine( )

Return view engine instance

Return view engine instance

Returns

momentphp\interfaces\ViewEngineInterface
public string
# render( null|string $template = null, null|string $bundle = null )

Render template content

Render template content

Parameters

$template
$bundle

Returns

string
public boolean
# exists( null|string $template = null, null|string $bundle = null )

Check if given template exists

Check if given template exists

Parameters

$template
$bundle

Returns

boolean
protected string
# path( string $template )

Return template path

Return template path

Parameters

$template

Returns

string
protected string
# mediaTypeTemplate( string $template )

Return template path based on detected media type

Return template path based on detected media type

Parameters

$template

Returns

string
public mixed
# __call( string $method, array $args = [] )

Universal getter/setter

Universal getter/setter

Parameters

$method
$args

Returns

mixed
Methods used from momentphp\traits\ContainerTrait
container()
Properties summary
protected array $guarded

Guarded properties

Guarded properties

# [ 'viewEngine', ]
protected string $engine

The name of the service implementing \momentphp\interfaces\ViewEngineInterface

The name of the service implementing \momentphp\interfaces\ViewEngineInterface

#
protected momentphp\interfaces\ViewEngineInterface $viewEngine

View engine

View engine

#
protected string $template

Template file to render

Template file to render

#
protected string $templateFolder

Template folder

Template folder

#
protected string $bundle

Bundle alias (if template should be rendered out of specific bundle)

Bundle alias (if template should be rendered out of specific bundle)

#
protected array $vars

Variables for the template

Variables for the template

# []
protected Psr\Http\Message\RequestInterface $request

Request

Request

#
protected Psr\Http\Message\ResponseInterface $response

Response

Response

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