PHP code example of axllent / silverstripe-textile-parser

1. Go to this page and download the library: Download axllent/silverstripe-textile-parser 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/ */

    

axllent / silverstripe-textile-parser example snippets


TextileParser::$doctype = 'xhtml'; // Use xhtml instead of html5
TextileParser::$use_restricted = false; // Use regular parser instead of restricted one (adds more features)

// convert the value into HTML, and convert raw web & email links into html links
$MyTextField.Textile

// which will convert the value into HTML, but leave links & emails as plain text
$MyTextField.Textile(0)