public static function fromRequest(Request $request) { if ($request->hasPost() && $request->getPostItem('submit') == 'From DataString') { $dataString = $request->getPostItem('datastring'); return self::fromDataString($dataString); } }
public function indexAction() { $generator = new CodeGenerator(); $modules = $this->container->getParameter('marijnk_koesen_code_generator.modules'); $html = $generator->generateHtml(\codegenerator\Request::getCurrentRequest(), $modules); return $this->render('MarijnKoesenCodeGeneratorBundle::index.html.twig', array('generatorHtml' => $html)); }