PHP code example of sheadawson / silverstripe-blocks

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

    

sheadawson / silverstripe-blocks example snippets


public function getIcon()
{
		return '<i class="fa fa-thumbs-up fa-3x" title="' . $this->singular_name() . '" aria-hidden="true"></i>';
}
public function getTypeForGridfield()
{
		$icon = $this->getIcon();
		if ($icon) {
				$obj = HTMLText::create();
				$obj->setValue($icon);
				return $obj;
		} else {
				return parent::getTypeForGridfield();
		}
}
 php
CMSMenu::remove_menu_item('BlockAdmin');