Reference - Parms functions - emoji


App: regression/framework - Page: tags/emoji_pipe_replaces_the_shortcodes_it_knows
PHP
HTML
tags/emoji_pipe_replaces_the_shortcodes_it_knows.pad
Result
{echo 'Shipped :rocket::tada: at 10:30:00 - :unknown_code: stays' | emoji}


App: showcase - Page: emoji/chat
PHP
emoji/chat.php
HTML
emoji/chat.pad
Result
<?php

// Messages as people type them, shortcodes and all.

$messages = [
[
'who' => 'Ana', 'text' => 'The build is green :white_check_mark: shipping it :rocket:' ],
[
'who' => 'Bram', 'text' => 'Nice work :clap: :clap:' ],
[
'who' => 'Chen', 'text' => 'Coffee at 10:30:00? :coffee:' ],
[
'who' => 'Dewi', 'text' => 'Count me in :raised_hand: - and :not_a_code: stays as it is' ],
];

?>
{meta title='Shortcodes in text', about='The emoji pipe turns every shortcode in a text into its emoji - one it does not know, or a time like 10:30:00, stays as written.'}
<ul style="list-style:none;margin:0;padding:0;max-width:30em;display:grid;gap:10px">
{messages}
<li style="padding:10px 14px;border-radius:14px;background:rgba(42,120,214,.1);line-height:1.5"><strong>{$who}</strong>: {$text | emoji}</li>
{/messages}
</ul>


App: tags - Page: examples/emoji/2-label
PHP
HTML
examples/emoji/2-label.pad
Result
{meta title='Another name to say', about='label= replaces the name a screen reader says; the pipe form turns the shortcodes in a text into emoji.'}
<p>Status: {emoji 'white_check_mark', label='Build passed'} {emoji 'warning', label='Two warnings'}</p>
{set $message = 'Shipped :rocket: at 10:30:00 - thanks all :clap:'}
<p>{$message | emoji}</p>