PHP code example of corrivate / tailwhen

1. Go to this page and download the library: Download corrivate/tailwhen library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

corrivate / tailwhen example snippets


<span class="<?= tailwhen([
    'bg-red-800', // always
    'text-white' => is_string('yes'), // condition is true, so style is applied
    'font-bold' => is_numeric('no') // condition is false, so style is not applied
])