Created
September 27, 2016 07:28
-
-
Save eSlider/c3a0d056480fa3fa949af13596edc305 to your computer and use it in GitHub Desktop.
Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mapbender\ConfiguratorBundle\Controller; | |
use FOM\ManagerBundle\Configuration\Route; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
/** | |
* Mapbender application management | |
* | |
* @Route("configurator/") | |
*/ | |
class BaseController extends Controller | |
{ | |
/** | |
* Get and optional decode JSON request data | |
* | |
* @return mixed | |
*/ | |
protected function getRequestData() | |
{ | |
$content = $this->getRequest()->getContent(); | |
$request = array_merge($_POST, $_GET); | |
if (!empty($content)) { | |
$request = array_merge($request, json_decode($content, true)); | |
} | |
return $request; | |
} | |
/** | |
* @return string | |
*/ | |
protected function getConfigurationPath() | |
{ | |
$kernel = $this->container->get("kernel"); | |
$configPath = $kernel->getRootDir() . "/config"; | |
return $configPath; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment