PHP code example of psdi / motif

1. Go to this page and download the library: Download psdi/motif 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/ */

    

psdi / motif example snippets



// index.php
r;

// [1] Prints 'Hello, world!' (bold and underlined) in green on console
echo Formatter::formatLine('Hello, world!', 'bold|color:green');

// [2,3] Examples with and without line breaks
echo Formatter::format('Somebody once told me,', 'strike|color:black|bg:blue');
echo Formatter::formatLine(' the world was gonna roll me.', 'underline|color:cyan');

// [4] Prints 'Error downloading files.' in white with a red background
echo Formatter::display('Error downloading files.', 'error');

// [5,6,7] Some more examples
echo Formatter::formatLine('This is a sample text. ', 'bold,italic|color:yellow');
echo Formatter::formatLine(
    'This is also a sample text, but in magenta.',
    'italic|color:magenta'
);
echo Formatter::display('Success! •ᴗ•', 'success');