In another question, someone posted this code in an answer to my question.
drupal_set_message(
t('Some Message @title'), array('@title' => $form_state['values']['title']))
);
It looks to me that the "@title" is substituted with $form_state['values']['title']
.
What is this called and what are the advantages and disadvantage of it?
From a quick look, I see that @ is used for error suppression, but this is reported in a PHP 4.3 book I have, rather than PHP 5.
In Drupal, an
@
sign in front of a placeholder is used to signal to Drupal's string parser to run the string attached to the placeholder throughcheck_plain()
.More info about string placeholders can be found on the
t()
API page.