PHP code example of alangasar / dm

1. Go to this page and download the library: Download alangasar/dm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alangasar / dm example snippets



$node = Node::load(1);

#Print $node dump to screen 
dm($node);

#Print $node dump to system watchdog
wdm($node);

function wdm($object, $type = 'wdm'){
    \Drupal::logger($type)->notice('<pre><code>' . print_r($object, TRUE) . '</code></pre>' );
}