FormattableMarkup : Add parameters, links to a text, table cell data. | Drupal 8

FormattableMarkup : Add parameters, links to a text, table cell data.

Submitted by editor on Mon, 01/22/2018 - 12:15
Question

How to create a  dynamic text to add a parameter or link ?
How to add a link to a table particular column ?

Create a customizable text.

Example :
use Drupal\Component\Render\FormattableMarkup;
$text = new FormattableMarkup('My name is @name', ['@name' => "The name"]);

Theme table row to link particular column data.

Example:
use Drupal\Component\Render\FormattableMarkup;
$rows[] = [
'data' => [
  'name' => new FormattableMarkup('<a href=":link">@name</a>', [':link' => $url, '@name' => $name]),
  'mail' => $row->mail,
]];

Comments

Campbell Damari (not verified)

Thu, 07/19/2018 - 12:03

Tables are best in case you're displaying unthinkable information. "div tag is desirable over the table" table is a general guideline that is shamefully connected by individuals who don't hear what they're saying. It's ideal for designing. Best Essay Writing Service. Casings are awful on the grounds that the information is in the wrong request in the record, despite the fact that it indicates appropriately on the site.

Add new comment