You are here

public function AddDataPolicyRevision::build in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  2. 8.2 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  3. 8.3 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  4. 8.4 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  5. 8.6 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  6. 8.7 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  7. 8.8 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  8. 10.0.x modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()
  9. 10.1.x modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php \Drupal\social_gdpr\Plugin\Block\AddDataPolicyRevision::build()

Builds and returns the renderable array for this block plugin.

If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with #cache set (with cacheability metadata indicating the circumstances for it being empty).

Return value

array A renderable array representing the content of the block.

Overrides BlockPluginInterface::build

See also

\Drupal\block\BlockViewBuilder

File

modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php, line 23

Class

AddDataPolicyRevision
Provides a 'AddDataPolicyRevision' block.

Namespace

Drupal\social_gdpr\Plugin\Block

Code

public function build() {
  return [
    'content' => [
      '#type' => 'link',
      '#title' => $this
        ->t('Add new revision'),
      '#url' => Url::fromRoute('social_gdpr.data_policy.add'),
      '#attributes' => [
        'class' => [
          'btn',
          'btn-primary',
          'btn-raised',
          'btn-full',
          'waves-effect',
          'brand-bg-primary',
        ],
      ],
    ],
  ];
}