1
votes

I'm using the PHPTemplate theme engine to create a theme in Drupal 7. So I have a bunch of .php.tpl template files that have theme variables made available to them through the Drupal bootstrap process.

Naturally, since these variables aren't defined in the template files themselves, or in explicitly included files, Zend Studio 9 gives a bunch of 'undefined variable' errors.

Is there any way to resolve, or at least suppress these errors?

2

2 Answers

2
votes

There isn't a way to tell the PHP analyser to ignore specific undefined variables in template files. The best you can do is to turn off all "undefined variable" warnings.

It would be really nice if you could add something like this to the top of the template:

/**
 * Template to display a node.
 *
 * @defined $node The current node
 * @defined $title The page title
 */

which would both turn off the "undefined variable" warnings and also act as useful template documentation.

0
votes

A resolve might be created with the answer from in Zend Studio and Drupal: right click project > properties > PHP Include Path > Libraries > Add External Source Folder > select the folder where drupal is installed