where do I see errors when I write modules?

drupal dpm example

Search for: drupal dpm example

how to debug drupal


function satya_test_module_custom_theme() {

  $current_theme = variable_get('theme_default','none');
  watchdog("curtheeme",$current_theme);
  
  $path = $_GET['q'];
  $pos = strpos($path, 'satyatest'); 
  watchdog("position","p:" + $pos);
  if( $pos === 0) {
    watchdog("Switching to bartik", $path);
    return 'bartik';
  }
  else
  {
     return $current_theme;
  }
}

Use extreme caution as I am totally new to php and drupal in adapting some of these early examples.


function theme_satya_test_render_array($data)
{
  dpm($data);
  $d1 = $data[0]['d1'];
  return "Hello from render. and that.bbbb";
}

The $data variable will be printed in a block at the top of the page when that page is displayed. Or when you access the site next if this attempt fails.