visualPaginatorFactory->create(); $paginator->ajax = false; $paginator->canSetItemsPerPage = true; $paginator->setItemsPerPage(100); //$paginator->templateFile = __DIR__ . '/my_awesome_template.latte'; return $paginator; } public function searchFormSucceededIpa(UI\Form $form, $values) { $translation = $values->translation; $term = $values->string; $clen = $values->clen; $result = $this->doSearch('TermsFullQuery', $translation, $term, $clen); $this->template->result = $result; } public function searchFormSucceededInteractive(UI\Form $form, $values) { $term = $values->string; $translation = $values->translation; $result = $this->doSearch('TermsFullQuery', $translation, $term, null); $this->template->result = $result; } public function actionPlay($id = null) { $pron = $this->em->getPronunciationRepository()->find(['id' => $id]); $basepath = $this->getHttpRequest()->url->basePath . "/media"; $oggResp = new OggResponse($id, $pron->filename); return $this->sendResponse($oggResp); } public function actionDefault() { if ($this->getRequest()->isMethod('GET') && $this->term) { $this['searchForm']['string']->setValue($this->term); $t = $this->slugs[$this->slug]; $result = $this->doSearch('TermsQuery',$t->id,$this->term); if ($result) $this->template->result = $result; } else { $this->term = $this['searchForm']['string']->getValue(); } $this['searchForm']->onSuccess[] = array($this, 'searchFormSucceeded'); } public function actionSelect($slug, $term = null) { $this['searchForm']->onSuccess[] = array($this, 'searchFormSucceededIpa'); if ($this->getRequest()->isMethod('GET')) { if (isset($this->slugs[$slug])) { $t = $this->slugs[$slug]; $this['searchForm']['translation']->setValue($t->id); $translation = $t; } } else { $id = $this['searchForm']['translation']->value; dump($id); if (isset($this->translations[$id])) { $t = $this->translations[$id]; $this->redirect('Front:Home:select', $t["slug"], $this['searchForm']['string']->value); } } if ($term) { $query = new TermsFullQuery($translation->dictionary, $term, $translation->direction); $result = $this->repoTerms->fetch($query); $this->template->result = $result; $this->template->translation = $translation; } $this->setView('ipa'); } public function renderDefault() { } public function actionIpa() { if ($this->getRequest()->isMethod('GET')) { if ($this->term) { $this['searchForm']['string']->setValue($this->term); $result = $this->doSearch('TermsFullQuery', $this->slugs[$this->slug]->id, $this->term); if ($result) $this->template->result = $result; } } $this['searchForm']->onSuccess[] = array($this, 'searchFormSucceededIpa'); } public function actionInteractive() { if ($this->getRequest()->isMethod('GET')) { if ($this->term) { $this['searchForm']['string']->setValue($this->term); $result = $this->doSearch('TermsFullQuery', $this->slugs[$this->slug]->id, $this->term); if ($result) $this->template->result = $result; } } $this['searchForm']->onSuccess[] = array($this, 'searchFormSucceededInteractive'); } public function renderAutocomplete($whichData, $typedText = '', $translation = 1) { $translation = $this->repoTranslations->find($translation); $query = new TermsQuickQuery($translation->dictionary, $typedText, $translation->direction); $result = $this->repoTerms->fetch($query); $map = []; foreach ($result as $str) { $map[] = $str["string1"]; } return $this->sendResponse(new JsonResponse($map)); } public function renderIpa() { } public function renderMerge() { } }