Skip to content

Instantly share code, notes, and snippets.

@richardDobron
Last active July 11, 2022 18:31
Show Gist options
  • Save richardDobron/faa29c058615a1a8f50a8acbe7e3ecf3 to your computer and use it in GitHub Desktop.
Save richardDobron/faa29c058615a1a8f50a8acbe7e3ecf3 to your computer and use it in GitHub Desktop.
<?php
// simple text:
echo fbt('Save', 'Button: Save a form or settings');
// text with params:
$name = 'Patricia';
$gender = 2;
echo fbt(
\fbt\fbt::name(
'name',
'<a href="#">' . $name . '</a>',
$gender
) .
' shared a link. Tell ' . \fbt\fbt::sameParam('name') . ' you liked it.',
'Notification about sharing a link.'
);
// is same as:
?>
<?php fbtTransform(); ?>
<fbt desc="param example">
<fbt:name name="name" gender="<?=$gender?>">
<a href="#"><?=$name?></a>
</fbt:name>
shared a link. Tell
<fbt:same-param name="name" />
you liked it.
</fbt>
<?php endFbtTransform(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment