View
in package
Class View.
Table of Contents
- $baseDir : string|null
- $blocks : array<string|int, mixed>
- $currentView : string
- $debugCollector : ViewCollector
- $extension : string
- $includePrefix : string
- $inInclude : bool
- $layout : string
- $layoutPrefix : string
- $layoutsOpen : array<string|int, mixed>
- $openBlock : string|null
- $openBlocks : array<string|int, mixed>
- $showDebugComments : bool
- __construct() : mixed
- __destruct() : mixed
- block() : static
- currentBlock() : string|null
- disableDebugComments() : static
- Disable debug comments when in debug mode.
- enableDebugComments() : static
- Enable debug comments when in debug mode.
- endBlock() : static
- extends() : static
- extendsWithoutPrefix() : static
- getBaseDir() : string|null
- getExtension() : string
- getIncludePrefix() : string
- getLayoutPrefix() : string
- hasBlock() : bool
- inBlock() : bool
- include() : string
- includeWithoutPrefix() : string
- inLayout() : bool
- isShowingDebugComments() : bool
- Tells if it is showing debug comments when in debug mode.
- removeBlock() : static
- render() : string
- renderBlock() : string|null
- setBaseDir() : static
- setDebugCollector() : static
- setExtension() : static
- setIncludePrefix() : static
- setLayoutPrefix() : static
- getContents() : string
- getFilepath() : string
- getIncludeContents() : string
- getIncludeContentsWithDebug() : string
- getNamespacedFilepath() : string
- involveInclude() : string
- makeDirectoryPrefix() : string
- setDebugData() : static
Properties
$baseDir
protected
string|null
$baseDir
= null
$blocks
protected
array<string|int, mixed>
$blocks
$currentView
protected
string
$currentView
$debugCollector
protected
ViewCollector
$debugCollector
$extension
protected
string
$extension
$includePrefix
protected
string
$includePrefix
= ''
$inInclude
protected
bool
$inInclude
= false
$layout
protected
string
$layout
$layoutPrefix
protected
string
$layoutPrefix
= ''
$layoutsOpen
protected
array<string|int, mixed>
$layoutsOpen
= []
$openBlock
protected
string|null
$openBlock
$openBlocks
protected
array<string|int, mixed>
$openBlocks
= []
$showDebugComments
protected
bool
$showDebugComments
= true
Methods
__construct()
public
__construct([string $baseDir = null ][, string $extension = '.php' ]) : mixed
Parameters
- $baseDir : string = null
- $extension : string = '.php'
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —block()
public
block(string $name) : static
Parameters
- $name : string
Return values
static —currentBlock()
public
currentBlock() : string|null
Return values
string|null —disableDebugComments()
Disable debug comments when in debug mode.
public
disableDebugComments() : static
Tags
Return values
static —enableDebugComments()
Enable debug comments when in debug mode.
public
enableDebugComments() : static
Tags
Return values
static —endBlock()
public
endBlock() : static
Return values
static —extends()
public
extends(string $layout[, string $openBlock = null ]) : static
Parameters
- $layout : string
- $openBlock : string = null
Return values
static —extendsWithoutPrefix()
public
extendsWithoutPrefix(string $layout) : static
Parameters
- $layout : string
Return values
static —getBaseDir()
public
getBaseDir() : string|null
Return values
string|null —getExtension()
public
getExtension() : string
Return values
string —getIncludePrefix()
public
getIncludePrefix() : string
Return values
string —getLayoutPrefix()
public
getLayoutPrefix() : string
Return values
string —hasBlock()
public
hasBlock(string $name) : bool
Parameters
- $name : string
Return values
bool —inBlock()
public
inBlock(string $name) : bool
Parameters
- $name : string
Return values
bool —include()
public
include(string $view[, array<string, mixed> $data = [] ]) : string
Parameters
- $view : string
- $data : array<string, mixed> = []
Return values
string —includeWithoutPrefix()
public
includeWithoutPrefix(string $view[, array<string, mixed> $data = [] ]) : string
Parameters
- $view : string
- $data : array<string, mixed> = []
Return values
string —inLayout()
public
inLayout(string $layout) : bool
Parameters
- $layout : string
Return values
bool —isShowingDebugComments()
Tells if it is showing debug comments when in debug mode.
public
isShowingDebugComments() : bool
Tags
Return values
bool —removeBlock()
public
removeBlock(string $name) : static
Parameters
- $name : string
Return values
static —render()
public
render(string $view[, array<string, mixed> $data = [] ]) : string
Parameters
- $view : string
- $data : array<string, mixed> = []
Return values
string —renderBlock()
public
renderBlock(string $name) : string|null
Parameters
- $name : string
Return values
string|null —setBaseDir()
public
setBaseDir(string $baseDir) : static
Parameters
- $baseDir : string
Return values
static —setDebugCollector()
public
setDebugCollector(ViewCollector $debugCollector) : static
Parameters
- $debugCollector : ViewCollector
Return values
static —setExtension()
public
setExtension(string $extension) : static
Parameters
- $extension : string
Return values
static —setIncludePrefix()
public
setIncludePrefix(string $prefix) : static
Parameters
- $prefix : string
Return values
static —setLayoutPrefix()
public
setLayoutPrefix(string $prefix) : static
Parameters
- $prefix : string
Return values
static —getContents()
protected
getContents(string $view, array<string, mixed> $data) : string
Parameters
- $view : string
- $data : array<string, mixed>
Return values
string —getFilepath()
protected
getFilepath(string $view) : string
Parameters
- $view : string
Return values
string —getIncludeContents()
protected
getIncludeContents(string $view[, array<string, mixed> $data = [] ]) : string
Parameters
- $view : string
- $data : array<string, mixed> = []
Return values
string —getIncludeContentsWithDebug()
protected
getIncludeContentsWithDebug(string $view[, array<string, mixed> $data = [] ]) : string
Parameters
- $view : string
- $data : array<string, mixed> = []
Return values
string —getNamespacedFilepath()
protected
getNamespacedFilepath(string $view) : string
Parameters
- $view : string
Return values
string —involveInclude()
protected
involveInclude(string $view, string $contents) : string
Parameters
- $view : string
- $contents : string
Return values
string —makeDirectoryPrefix()
protected
makeDirectoryPrefix(string $prefix) : string
Parameters
- $prefix : string
Return values
string —setDebugData()
protected
setDebugData(string $file, float $start, string $type) : static
Parameters
- $file : string
- $start : float
- $type : string