Craft Themes (3.x)

CurrentUserBlock extends Block
in package

Block displaying the current user

Table of Contents

$active  : bool
$dateCreated  : DateTime
$dateUpdated  : DateTime
$handle  : string
$id  : int
$layout_id  : int
$order  : int
$provider  : string
$region  : string
$uid  : string
$_cacheStrategy  : CacheStrategyInterface
$_cacheStrategyHandle  : string
$_cacheStrategyOptions  : array<string|int, mixed>
$_layout  : LayoutInterface
$_optionsModel  : BlockOptions
$_viewMode  : ViewModeInterface
afterSave()  : mixed
Callback after the block has been saved
beforeRender()  : bool
Callback before rendering, returning false will skip the block rendering.
defineRules()  : array<string|int, mixed>
fields()  : mixed
getCacheStrategy()  : BlockCacheStrategyInterface|null
Get the cache strategy for this block
getCanBeCached()  : bool
Can this block be cached
getConfig()  : array<string|int, mixed>
Project config to be saved
getErrors()  : mixed
getHandle()  : string
Get block handle
getLayout()  : LayoutInterface
Get layout object
getLongDescription()  : string
Long description getter
getMachineName()  : string
Get full machine name, in the form provider-handle
getName()  : string
getOptions()  : BlockOptions
Get options model
getSmallDescription()  : string
getTemplates()  : array<string|int, string>
Get available templates
getUserLayout()  : LayoutInterface
Get layout associated to user defined in options
getViewMode()  : ViewModeInterface|null
Get view mode for current user and eager load it
getViewModes()  : array<string|int, mixed>
Get all view modes for user layout
hasErrors()  : mixed
init()  : mixed
isVisible()  : bool
Is this block visible
provider()  : BlockProviderInterface
Get provider object
render()  : Markup
Render this block
setCacheStrategy()  : mixed
Set the cache strategy, $strategy should be an array : [ 'handle' => 'strategyHandle', 'options' => [] ]
setLayout()  : mixed
Set layout object
setOptions()  : mixed
Options setter
toArray()  : mixed
getOptionsModel()  : string
Model class that defines this block's options

Properties

$active

public bool $active = true

$dateCreated

public DateTime $dateCreated

$dateUpdated

public DateTime $dateUpdated

$layout_id

public int $layout_id

$order

public int $order = 0

$provider

public string $provider

$region

public string $region

$_cacheStrategy

protected CacheStrategyInterface $_cacheStrategy

$_cacheStrategyHandle

protected string $_cacheStrategyHandle

$_cacheStrategyOptions

protected array<string|int, mixed> $_cacheStrategyOptions = []

Methods

afterSave()

Callback after the block has been saved

public afterSave() : mixed
Tags
inheritDoc
Return values
mixed

beforeRender()

Callback before rendering, returning false will skip the block rendering.

public beforeRender() : bool
Tags
inheritDoc
Return values
bool

defineRules()

public defineRules() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

fields()

public fields() : mixed
Tags
inheritDoc
Return values
mixed

getCanBeCached()

Can this block be cached

public getCanBeCached() : bool
Tags
inheritDoc
Return values
bool

getConfig()

Project config to be saved

public getConfig() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

getErrors()

public getErrors([mixed $attribute = null ]) : mixed
Parameters
$attribute : mixed = null
Tags
inheritDoc
Return values
mixed

getHandle()

Get block handle

public getHandle() : string
Tags
inheritDoc
Return values
string

getLongDescription()

Long description getter

public getLongDescription() : string
Tags
inheritDoc
Return values
string

getMachineName()

Get full machine name, in the form provider-handle

public getMachineName() : string
Tags
inheritDoc
Return values
string

getName()

public getName() : string
Tags
inheritDoc
Return values
string

getSmallDescription()

public getSmallDescription() : string
Tags
inheritDoc
Return values
string

getTemplates()

Get available templates

public getTemplates(LayoutInterface $layout) : array<string|int, string>
Parameters
$layout : LayoutInterface
Tags
inheritDoc
Return values
array<string|int, string>

getViewModes()

Get all view modes for user layout

public getViewModes() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasErrors()

public hasErrors([mixed $attribute = null ]) : mixed
Parameters
$attribute : mixed = null
Tags
inheritDoc
Return values
mixed

init()

public init() : mixed
Tags
inheritDoc
Return values
mixed

isVisible()

Is this block visible

public isVisible() : bool
Tags
inheritDoc
Return values
bool

render()

Render this block

public render() : Markup
Tags
inheritDoc
Return values
Markup

setCacheStrategy()

Set the cache strategy, $strategy should be an array : [ 'handle' => 'strategyHandle', 'options' => [] ]

public setCacheStrategy(mixed $strategy) : mixed
Parameters
$strategy : mixed
Tags
inheritDoc
Return values
mixed

setOptions()

Options setter

public setOptions(mixed $options) : mixed
Parameters
$options : mixed
Tags
inheritDoc
Return values
mixed

toArray()

public toArray([array<string|int, mixed> $fields = [] ][, array<string|int, mixed> $expand = [] ][, mixed $recursive = true ]) : mixed
Parameters
$fields : array<string|int, mixed> = []
$expand : array<string|int, mixed> = []
$recursive : mixed = true
Tags
inheritDoc
Return values
mixed

getOptionsModel()

Model class that defines this block's options

protected getOptionsModel() : string
Tags
inheritDoc
Return values
string

Search results