silverstripe-framework/tests/php/Control/RequestHandlingTest/HTTPMethodTestController.php
2020-02-14 14:41:10 +13:00

33 lines
726 B
PHP

<?php
namespace SilverStripe\Control\Tests\RequestHandlingTest;
use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Dev\TestOnly;
class HTTPMethodTestController extends Controller implements TestOnly
{
private static $url_segment = 'HTTPMethodTestController';
private static $url_handlers = [
'GET /' => 'getRoot',
'POST ' => 'postLegacyRoot',
];
private static $allowed_actions = [
'getRoot',
'postLegacyRoot',
];
public function getRoot(HTTPRequest $request)
{
return "Routed to getRoot";
}
public function postLegacyRoot(HTTPRequest $request)
{
return "Routed to postLegacyRoot";
}
}