mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
06364af3c3
Move states to sub namespace
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace SilverStripe\Control\Tests\DirectorTest;
|
|
|
|
use SilverStripe\Control\Controller;
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
class TestController extends Controller implements TestOnly
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
if (Controller::has_curr()) {
|
|
$this->setRequest(Controller::curr()->getRequest());
|
|
}
|
|
}
|
|
|
|
private static $url_segment = 'TestController';
|
|
|
|
private static $allowed_actions = array(
|
|
'returnGetValue',
|
|
'returnPostValue',
|
|
'returnRequestValue',
|
|
'returnCookieValue',
|
|
);
|
|
|
|
public function returnGetValue($request)
|
|
{
|
|
if (isset($_GET['somekey'])) {
|
|
return $_GET['somekey'];
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public function returnPostValue($request)
|
|
{
|
|
if (isset($_POST['somekey'])) {
|
|
return $_POST['somekey'];
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public function returnRequestValue($request)
|
|
{
|
|
if (isset($_REQUEST['somekey'])) {
|
|
return $_REQUEST['somekey'];
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public function returnCookieValue($request)
|
|
{
|
|
if (isset($_COOKIE['somekey'])) {
|
|
return $_COOKIE['somekey'];
|
|
}
|
|
return null;
|
|
}
|
|
}
|