Featured Post

What is the purpose of the php.ini file?

  The PHP configuration file,   php.ini , is the final and most immediate way to affect PHP's functionality. The php.ini file is read ea...

Showing posts with label Drupal 7 interview questions. Show all posts
Showing posts with label Drupal 7 interview questions. Show all posts

Global variables of Drupal 7

Scope can be defined as the range of availability a variable has to the program in which it is declared. PHP variables can be one of four scope types:
  1. Local variables
  2. Function parameters
  3. Global variables
  4. Static variables.
Global Variables:
In contrast to local variables, a global variable can be accessed in any part of the program. However, in order to be modified, a global variable must be explicitly declared to be global in the function in which it is to be modified. This is accomplished, conveniently enough, by placing the keyword GLOBAL in front of the variable that should be recognized as global. Placing this keyword in front of an already existing variable tells PHP to use the variable having that name.
Here are the list of Drupal Global Variables:

How to display the SQL query in Drupal 7 views?

When working in the Views module, you may want to preview the SQL that is generated by the view. This is for the code savvy or the ones looking to be and would like to see the SQL generated for either debugging or further development of their views. Sometimes seeing the code can help understand how the view works in case it needs further tweaking. Showing the SQL query for a View's preview is done with the following instructions.

Popular Posts