some Fix
This commit is contained in:
@@ -35,19 +35,19 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
protected function startup()
|
||||
{
|
||||
$trs = $this->em->getRepository(Translation::class)->findBy([],['id' => 'ASC','direction'=>'ASC']);
|
||||
$drs = $this->em->getRepository(Dictionary::class)->findPairs([],'name',[],'id');
|
||||
$drs = $this->em->getRepository(Dictionary::class)->findPairs('id','name');
|
||||
$select = [];
|
||||
foreach ($trs as $t) {
|
||||
$lang1 = $t->langName1;
|
||||
$lang2 = $t->langName2;
|
||||
$lang1 = $t->getLangName1();
|
||||
$lang2 = $t->getLangName2();
|
||||
|
||||
$lang = mb_substr($lang1,0,-1);
|
||||
$lang .= "o-".$lang2;
|
||||
$slug = Strings::webalize($lang);
|
||||
$select[$drs[$t->dictionary->id]][$t->id] = $lang;
|
||||
$translations[$t->id]["slug"] = $slug;
|
||||
$translations[$t->id]["lang"] = $lang;
|
||||
$translations[$t->id]["t"] = $t;
|
||||
$select[$drs[$t->getDictionary()->getId()]][$t->getId()] = $lang;
|
||||
$translations[$t->getId()]["slug"] = $slug;
|
||||
$translations[$t->getId()]["lang"] = $lang;
|
||||
$translations[$t->getId()]["t"] = $t;
|
||||
$slugs[$slug] = $t;
|
||||
|
||||
}
|
||||
@@ -154,7 +154,7 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
|
||||
public function beforeRender()
|
||||
{
|
||||
$dicttypes = $this->repoDictTypes->findAssoc([],'id');
|
||||
$dicttypes = $this->em->getDictTypeRepository()->findPairs('id');
|
||||
$this->template->dicttypes = $dicttypes;
|
||||
$this->template->dictionaries = $this->dictionaries;
|
||||
$this->template->translations = $this->translations;
|
||||
|
||||
Reference in New Issue
Block a user