tags:

views:

123

answers:

3

Possible Duplicate:
@ (at sign) in drupal

I know that sometimes it has to do with error suppression but I'm looking at Drupal code and I can't recognize the syntax:

Example 1:

$batch = array(
'operations' => $operations,
'finished' => '_install_profile_batch_finished',
'title' => st('Installing @drupal', array('@drupal' => drupal_install_profile_name())),
'error_message' => st('The installation has encountered an error.'),
);

Example 2:

drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_name())));

Example 3:

$output .= '<p>'. (isset($messages['error']) ? st('Please review the messages above before continuing on to <a href="@url">your new site</a>.', array('@url' => url(''))) : st('You may now visit <a href="@url">your new site</a>.', array('@url' => url('')))) .'</p>';
A: 

It is part of the drupal template engine. This is a flag for a replacement variable.

CrazyDart
Not here. read the question first.
Colin Hebert
this is not right, please read the question.
Femaref
How is that not right? Its essentially the same answer as yours with 8 upvotes. Drupal can use replacements.
Kevin
the answer was edited after my comment and before your comment.
Femaref
+8  A: 

This hasn't to do with php, but with drupal. @drupal is a variable used by the templating engine drupal uses.

Femaref
+2  A: 

This is Drupal specific, it means the variable is run through check_plain, which escapes HTML characters (Relevant Drupal API documentation).

The t() and st() functions are used for translatable strings.

Fabian