Hi,
I am learning Drupal 8 and want to rewrite a module from Drupal 7. In my 7 module I have some links with images instead of text.
In Drupal 7 this looks like
$Link=l('
Text ', 'http://www.somewhere.xyz', array('html' => TRUE));
This seams not to work anymore. I found 'html' => TRUE is deprecated:
https://www.drupal.org/node/2273923
Here I found this to use in Drupal 8:
\Drupal::l(String::format('@cell_content@image', array('@cell_content' => $cell_content, '@image' => $image)), ...
... but it is not working! Error.log complains:
[Tue Jan 05 23:06:08.753111 2016] [:error] [pid 5172] [client ::1:54416] PHP Fatal error: Class 'Drupal\\bb\\Controller\\String' not found in /var/www/html/d8/modules/bb/src/Controller/bbDatenbankabfragen.php on line 72
What's my Error?
Thank you,
Stefan
Comments
I'm not sure if is the good
I'm not sure if is the good way to do but i use something like this: