Posted By

berkes on 02/13/08


Tagged

php debug template drupal phptemplate Development


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ReeceMarsland


Easy debug variable to find what vars are available in a tpl.php file


 / Published in: PHP
 

An easy debug trick: gives you a variable that you can print in any tpl.php to find out what vars you have available there.

  1. /**
  2.  */
  3. function _phptemplate_variables($hook, $vars) {
  4. //...
  5. $vars['args'] = $vars; //TODO: remove this debug variable.
  6. return $vars;
  7. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: DeadLy on February 13, 2008

$hook - what is?

Posted By: berkes on July 3, 2008

$hook is always passed to phptemplatevariables, it contains the theme hook being called. e.g 'block' in case theme_block() is called.

You need to login to post a comment.