PHP code example of fabiang / laminas-language-route
1. Go to this page and download the library: Download fabiang/laminas-language-route library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fabiang / laminas-language-route example snippets
$locale = $this->getEvent()->getRouteMatch()->getParam('locale');
$this->url()->fromRoute('home', ['locale' => 'de_DE']); // will point to /de
$this->url()->fromRoute('home', ['locale' => 'en_US']); // will point to /en
echo $this->languageSwitch($renderMode, $currentLocale, $options);