How to print the node body in a custom block? I am trying to print the node body in a custom block, but it's not showing up. I'm I doing this correctly? 

$refer = $_SERVER[HTTP_REFERER];
$parsed = parse_url($refer);
$alias = array_pop($parsed);
$dst = \Drupal::service('path.alias_manager')-&gt;getPathByAlias($alias , $langcode);
$nid = array_pop(explode('/', $dst));
$dest_node = node_load($nid);

$body = $dest_node-&gt;get('body')-&gt;getValue();
print $body; //have tried other printing methods also but invain


Thanks
$dest_node-&gt;get('body')-&gt;getValue();

this will return an array. So,$body is an array. 
If you want the Body field values, then get it by accessing the proper index of the $body array. i.e $body[0]['value']

just replace print $body; with print $body[0]['value'];