1
votes

I'm trying to learn Drupal modules. Can someone tell me what the '@' symbol is? I dont remember coming across it in PHP. (Its tricky to search for it cos as far as I can tell, you cant google for symbols). Can I convert it into a normal PHP variable, modify it and finally put it back into an @ thing within the PHP of the .module file?

UPDATE: e.g.:

  $error['msg'] = t("We're sorry. We have now only @qty of the ....

in file... http://drupal.org/project/uc_out_of_stock

2

2 Answers

5
votes

While that is the case in general PHP, it is used differently in Drupal within the t() function.

You can properly use placeholders in your text (which should be wrapped in t() for translation purposes on i18n capabilities) by putting a @ , ! or % in front.

! = insert as is

@ = run text through check_plain

% = html escape text

More info on the API page

1
votes

In PHP the @ symbol suppresses error messages.

There's plenty about it in the manual. When in doubt that's the place to go.

http://us3.php.net/manual/en/language.operators.errorcontrol.php