Skip to content

Instantly share code, notes, and snippets.

@eSlider
Created September 27, 2016 07:28
Show Gist options
  • Save eSlider/c3a0d056480fa3fa949af13596edc305 to your computer and use it in GitHub Desktop.
Save eSlider/c3a0d056480fa3fa949af13596edc305 to your computer and use it in GitHub Desktop.
Test
<?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