Craft Themes (4.x)

BlocksController extends Controller
in package

Controller for actions related to blocks

Table of Contents

EVENT_REGISTER_ASSET_BUNDLES  = 'register_asset_bundles'
$ajaxActions  : mixed
$blockCache  : BlockCacheService
$blockProviders  : BlockProvidersService
$blocks  : BlockService
$displays  : DisplayService
$fieldDisplayers  : FieldDisplayerService
$fields  : FieldsService
$groups  : GroupsService
$layouts  : LayoutService
$registry  : ThemesRegistry
$viewModes  : ViewModeService
actionBlockProviders()  : array<string|int, mixed>
Get all block providers as json
actionBlocks()  : array<string|int, mixed>
Get all blocks for a layout
actionDeleteLayout()  : array<string|int, mixed>
Delete a layout by id
actionIndex()  : Response
Blocks index
actionSave()  : array<string|int, mixed>
Save blocks
actionValidateBlockOptions()  : array<string|int, mixed>
Validate block options
afterAction()  : mixed
beforeAction()  : bool
init()  : void

Constants

EVENT_REGISTER_ASSET_BUNDLES

public mixed EVENT_REGISTER_ASSET_BUNDLES = 'register_asset_bundles'

Properties

$ajaxActions

protected mixed $ajaxActions = ['block-providers', 'delete-layout', 'blocks', 'save', 'validate-block-options']

$blockCache

protected BlockCacheService $blockCache

$blockProviders

protected BlockProvidersService $blockProviders

$fieldDisplayers

protected FieldDisplayerService $fieldDisplayers

Methods

actionBlockProviders()

Get all block providers as json

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

actionBlocks()

Get all blocks for a layout

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

actionDeleteLayout()

Delete a layout by id

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

actionIndex()

Blocks index

public actionIndex([string|null $themeName = null ][, int|null $layout = null ]) : Response
Parameters
$themeName : string|null = null
$layout : int|null = null
Return values
Response

actionSave()

Save blocks

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

actionValidateBlockOptions()

Validate block options

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

afterAction()

public afterAction(mixed $action, mixed $result) : mixed
Parameters
$action : mixed
$result : mixed
Tags
inheritDoc
Return values
mixed

beforeAction()

public beforeAction(mixed $action) : bool
Parameters
$action : mixed
Tags
inheritDoc
Return values
bool

init()

public init() : void
Tags
inheritDoc
Return values
void

Search results