how to get drupal block contents(using coding)

We can display any Drupal block anywhere in the website using the code given below.

<?php
$block = module_invoke( [module name], 'block', 'view', [block id] );
print $block['content'];
?> 

Comments

Popular posts from this blog

PHP - How to increase size of POST value in php

D8 KernelEvents constants

D8 - Attach file programmatically to a node