Elgg\Router::getPageHandlers PHP Method

getPageHandlers() public method

Get page handlers as array of identifier => callback
public getPageHandlers ( ) : array
return array
    public function getPageHandlers()
    {
        return $this->handlers;
    }

Usage Example

Example #1
0
 function testCanRegisterFunctionsAsPageHandlers()
 {
     $registered = $this->router->registerPageHandler('hello', array($this, 'hello_page_handler'));
     $this->assertTrue($registered);
     $path = "hello/1/€";
     // euro sign
     $qs = http_build_query(array(Application::GET_PATH_KEY => $path));
     $request = \Elgg\Http\Request::create("http://localhost/?{$qs}");
     ob_start();
     $handled = $this->router->route($request);
     $output = ob_get_clean();
     $this->assertTrue($handled);
     $this->assertEquals($path, $output);
     $this->assertEquals(array('hello' => array($this, 'hello_page_handler')), $this->router->getPageHandlers());
 }
All Usage Examples Of Elgg\Router::getPageHandlers