Reputation: 3952
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
Upvotes: 1
Views: 135
Reputation: 901
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
Upvotes: 5
Reputation: 13947
In PHP the @ symbol suppresses error messages.
There's plenty about it in the manual. When in doubt that's the place to go.
https://www.php.net/manual/en/language.operators.errorcontrol.php
Upvotes: 1