Skip to content

Instantly share code, notes, and snippets.

@smarek
Last active September 19, 2019 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarek/1c69c9f3d4384a98d481837bb0351262 to your computer and use it in GitHub Desktop.
Save smarek/1c69c9f3d4384a98d481837bb0351262 to your computer and use it in GitHub Desktop.
cakephp i18n language link
<?php
$parsed = Router::parseRequest($this->request);
unset($parsed['_matchedRoute']);
echo $this->Html->link('Čeština', array_merge($parsed, ['lang' => 'cz']));
echo ' | ';
echo $this->Html->link('English', array_merge($parsed, ['lang' => 'en']));
echo ' | ';
echo $this->Html->link('French', array_merge($parsed, ['lang' => 'fr']));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment