DsRegionBlock.php in Display Suite 8.2
Same filename in this branch
Same filename and directory in other branches
Namespace
Drupal\ds_extras\Plugin\BlockFile
modules/ds_extras/src/Plugin/Block/DsRegionBlock.phpView source
<?php
namespace Drupal\ds_extras\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Provides the region block plugin.
*
* @Block(
* id = "ds_region_block",
* admin_label = @Translation("Ds region block"),
* category = @Translation("Display Suite"),
* deriver = "Drupal\ds_extras\Plugin\Derivative\DsRegionBlock"
* )
*/
class DsRegionBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
$id = $this
->getDerivativeId();
$data = drupal_static('ds_block_region');
if (!empty($data[$id])) {
return array(
'#markup' => drupal_render_children($data[$id]),
);
}
else {
return array();
}
}
}
Classes
Name | Description |
---|---|
DsRegionBlock | Provides the region block plugin. |