com\setasign\SetaSite\Block

AbstractTwigControllerBlock Interface BlockInterface

File: /SetaSite/src/Block/AbstractTwigControllerBlock.php

Class hierarchy

Implements

Summary

Constants

PROVIDED_FILES

protected const AbstractBlock::PROVIDED_FILES = array ( 0 => 'icon.png', )

Properties

$blockName

protected string AbstractBlock::$blockName

$defaultAction

protected string AbstractTwigControllerBlock::$defaultAction = 'index'

$di

$isBlockFinal

$logger

protected ?\Psr\Log\LoggerInterface AbstractBlock::$logger

$params

$renderContext

protected array AbstractTwigBlock::$renderContext = array()

$twig

$viewScript

protected string AbstractTwigBlock::$viewScript = 'html.twig'

Static Methods

getBlockPath()

abstract public static BlockInterface::getBlockPath (
void
): string

Just return DIR

getConfig()

final public static AbstractBlock::getConfig (
void
): \com\setasign\SetaFramework\Config\Config

getTwigNamespace()

public static AbstractTwigBlock::getTwigNamespace (
void
): string

lookupFile()

public static AbstractBlock::lookupFile (
string $file
): \com\setasign\SetaFramework\FileSystem\File
Parameters
$file : string
 
Exceptions

Throws \com\setasign\SetaSite\FileSystem\InvalidPathException

readConfig()

protected static AbstractBlock::readConfig (
void
): \com\setasign\SetaFramework\Config\Config

Methods

__construct()

public AbstractTwigBlock::__construct (
\com\setasign\SetaFramework\Di\Di $di,
\com\setasign\SetaSite\Twig\SetasiteTwigEnvironment $twig,
\com\setasign\SetaSite\SetaSite $setasite,
\com\setasign\SetaSite\SessionContext $sessionContext,
BlockParent\BlockParentInterface $blockParent,
string $blockName,
array $blockData
)

AbstractViewBlock constructor.

Parameters
$di : \com\setasign\SetaFramework\Di\Di
 
$twig : \com\setasign\SetaSite\Twig\SetasiteTwigEnvironment
 
$setasite : \com\setasign\SetaSite\SetaSite
 
$sessionContext : \com\setasign\SetaSite\SessionContext
 
$blockParent : BlockParent\BlockParentInterface
 
$blockName : string
 
$blockData : array
 

__clone()

public AbstractBlock::__clone (
void
): void

Implementation of __clone()

__sleep()

final public AbstractBlock::__sleep (
void
): void

Blocks aren't serializable.

Exceptions

Throws \BadMethodCallException

get()

Parameters
$propertyName : string
 

getBlockCache()

protected AbstractBlock::getBlockCache (
void
): ?\com\setasign\SetaFramework\SimpleCache\ValidationCacheEntry

getBlockCacheValidators()

protected AbstractBlock::getBlockCacheValidators (
void
): array

getCacheName()

protected AbstractBlock::getCacheName (
void
): string

Overwrite if you need an alternative cache name e.g. for ControllerBlock

getData()

public AbstractBlock::getData (
void
): array

getFullName()

public AbstractBlock::getFullName (
void
): string

getModuleAdapters()

If the block has some special functionality for an external module it will return an adapter for this otherwise the array is empty.

Parameters
$module : \com\setasign\SetaSite\Module\ModuleInterface
 

getName()

public AbstractBlock::getName (
void
): string

getSubpagesTree()

getUid()

public AbstractBlock::getUid (
void
): ?string

isBlockFinal()

public AbstractBlock::isBlockFinal (
void
): bool

notFoundAction()

preRender()

final protected AbstractTwigControllerBlock::preRender (
void
): void
Exceptions

Throws \com\setasign\SetaSite\HttpErrorException

Throws \Throwable

render()

public AbstractTwigBlock::render (
void
): string
Return Values

The rendered block

Exceptions

Throws ForceResponseException If the block forces a complete response.

Throws \com\setasign\SetaSite\HttpErrorException If the block forces a http error.

Throws \com\setasign\SetaFramework\Bootstrap\MaintenanceException

Throws BlockRenderException If something went wrong on rendering the block.

renderView()

private AbstractTwigBlock::renderView (
void
): string

This is the real render method.

This method will not be called if the cache is used.

Exceptions

Throws ForceResponseException

Throws \com\setasign\SetaSite\HttpErrorException

Throws \Throwable

setCache()

final public AbstractBlock::setCache (
\Psr\SimpleCache\CacheInterface $cache
): void
Parameters
$cache : \Psr\SimpleCache\CacheInterface
 

setLogger()

final public AbstractBlock::setLogger (
\Psr\Log\LoggerInterface $logger
): void

Sets a logger instance on the object.

Parameters
$logger : \Psr\Log\LoggerInterface
 

setParams()

public AbstractTwigControllerBlock::setParams (
array $params
): void
Parameters
$params : array