PHP code example of mattsplat / readmore

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

    

mattsplat / readmore example snippets


use Mattsplat\Readmore\ReadMore;

ReadMore::make('Notes'),

ReadMore::make('Notes')->hideFromIndex(),

ReadMore::make('Notes')
    ->characters(60)         // characters shown before truncating (default 20)
    ->mask('read more')      // the "reveal" indicator (default '...')
    ->lessLabel('collapse')  // the "collapse" control label (default 'Show less')
    ->rows(8),               // textarea rows on forms (default 5)

$icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path d="M6 2h9a1 1 0 0 1 .7.3l4 4a1 1 0 0 1 .3.7v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2z"/></svg>';

ReadMore::make('Notes')->characters(0)->mask($icon),