public function searchResultAction() { $this->logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__); //$this->logger->warning('hallo hier der logger' . __METHOD__); $debug = false; $isAjax = true; if ($this->request->hasArgument('ajax')) { $isAjax = true; } $args = $this->request->getArguments(); /** @var $searchForm \MUM\BjrFreizeit\Utility\LeisureSearchForm */ $searchForm = GeneralUtility::makeInstance('MUM\\BjrFreizeit\\Utility\\LeisureSearchForm', $args); if ($debug) { return json_encode(array('html' => print_r($searchForm, true), 'args' => $args)); } $leisures = $this->leisureRepository->findAllBySearchForm($searchForm); if ($leisures->count() > 0) { //$this->typoScript = $this->getFullTypoScript(); $this->view->assign('found', true); $this->view->assign('leisures', $leisures); $this->view->assign('imagePath', $this->settings['leisureImagePath']); $this->view->assign('detailPage', $this->settings['detailPage']); } else { $this->view->assign('found', false); } if ($isAjax) { $renderer = $this->getPlainRenderer('SearchResult', 'html'); $renderer->assign('found', $leisures->count() > 0); $renderer->assign('leisures', $leisures); $renderer->assign('imagePath', $this->settings['leisureImagePath']); $renderer->assign('detailPage', $this->settings['detailPage']); $html = $renderer->render(); //$html = $this->view->render(); $success = true; $this->logger->alert('SearchManager ', array('keyword' => $searchForm->getDescription())); $this->logger->alert('Arguments ', $args); return json_encode(array('html' => $html, 'success' => $success, 'arguments' => $args, 'searchManagerCategory' => $searchForm->getCategory(), 'number' => $leisures->count())); } else { } }
/** * Logs alert-leveled events * * @param string $message Log message * @param array $context Context data * * @return void */ public function alert($message, array $context = []) { $this->logger->alert($message, $context); }