1 layout_context.inc LayoutContext::isA($plugin)

Check if this context matches a plugin name.

This helps identify contexts which have aliases, such as a "node" context which is also considered an "entity" context.

For example:

$context = layout_create_context('node');

var_dump($context->isA('node')); // TRUE.
var_dump($context->isA('entity')); // TRUE.
var_dump($context->isA('user')); // FALSE.

Parameters

string $plugin:

Return value

bool:

File

core/modules/layout/plugins/context/layout_context.inc, line 332
Class that holds information relating to a layout's context.

Class

LayoutContext
@file Class that holds information relating to a layout's context.

Code

function isA($plugin) {
  return $plugin === $this->plugin || in_array($plugin, $this->aliases);
}