How can I extend classes?

For example I want to extend Router class. I’m creating a plugin and added my class.


namespace Cake\Routing;

use Cake\Core\Configure;
use Cake\Network\Request;
use Cake\Utility\Inflector;
use InvalidArgumentException;
use Psr\Http\Message\ServerRequestInterface;

class SEOfriendlyURLs_Routing extends Router 

    public static function parse($url, $method = '')
        echo $url;exit;
        return parent::parse($url, $method);


I added an entry into bootstrap file

Plugin::load('SEOfriendlyURLs'); // added SEO friendly URLs Plugin

But it don’t work’s. What am I doing wrong?