1.20.x 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

modules/layout/plugins/context/layout_context.inc, line 240
Class that holds information relating to a layouts context.

Class

LayoutContext
@file Class that holds information relating to a layouts context.

Code

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