PHP code example of pstaender / silverstripe-helper

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

    

pstaender / silverstripe-helper example snippets



class DBStringExtension extends SilverStripe\ORM\DataExtension {

	private static $casting = [
	  "Markdown"               => "HTMLFragment",
	  "MarkdownLine"           => "HTMLFragment",
	];

	use PhilippStaender\SilverStripeHelper\Markdown;

}


\SilverStripe\ORM\FieldType\DBString::add_extension(DBStringExtension::class);