@ (at) on Drupal lines

In another question, someone posted this code in the answer to my question.

drupal_set_message(
  t('Some Message @title'), array('@title' => $form_state['values']['title']))
);

It seems to me that "@title" is being replaced by $form_state['values']['title'].

What is it called and what are its advantages and disadvantages?

With a quick look, I see that @ is used to suppress errors, but this is reported in the book of PHP 4.3 with me, and not in PHP 5.

+2
source share
1 answer

In Drupal, the prefix character is @used for signatures for the Drupal string parser to launch a string attached to the placeholder through check_plain().

More information about line placeholders can be found on the page t().

+5
source

Source: https://habr.com/ru/post/1769236/


All Articles