/** * Returns the code for the panel itself * * @return string */ public function getPanel() { $lang_code = $this->translator->getActiveLanguageAndPlural()->getLanguage()->getIso639_1(); ob_start(); require __DIR__ . '/Templates/panel.phtml'; return ob_get_clean(); }
public function run() { $request_data = $this->getRequestData(); if ($request_data['action']) { try { if ($request_data['language']) { $this->translator->setActiveLanguageCode($request_data['language']); } $this->callActionByRequest($request_data); } catch (InvalidStateException $e) { $this->payload['message'] = $e->getMessage(); } return new JsonResponse($this->payload); } return null; }
public function testSetAndGetStorage() { $translator = new Translator(); $this->assertNull($translator->getStorage()); $storage = $this->createStorageMock(); $translator->setStorage($storage); $this->assertSame($storage, $translator->getStorage()); }