Elgg\Router::unregisterPageHandler PHP Method

unregisterPageHandler() public method

Unregister a page handler for an identifier
public unregisterPageHandler ( string $identifier ) : void
$identifier string The page type identifier
return void
    public function unregisterPageHandler($identifier)
    {
        unset($this->handlers[$identifier]);
    }

Usage Example

Example #1
0
 function testCanUnregisterPageHandlers()
 {
     $this->router->registerPageHandler('hello', array($this, 'hello_page_handler'));
     $this->router->unregisterPageHandler('hello');
     $request = \Elgg\Http\Request::create('http://localhost/hello/');
     ob_start();
     $handled = $this->router->route($request);
     $output = ob_get_clean();
     // Normally we would expect the router to return false for this request,
     // but since it checks for headers_sent() and PHPUnit issues output before
     // this test runs, the headers have already been sent. It's enough to verify
     // that the output we buffered is empty.
     // $this->assertFalse($handled);
     $this->assertEmpty($output);
 }
All Usage Examples Of Elgg\Router::unregisterPageHandler