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