Introduction
Link class helps you to create links & url's with language parameter in easy.
you can find Links class in ./Logaty/Helpers/Link.php
there's only one public method called create($link = '', $lang = ''$).
this class helps you to clean url and rebuild it to set language parameter in easy.
<?php
logaty()->link->create($link = '', $lang = '');
$link (Optional) the link you want to generate (or slug) .
$lang (Optional) the language for generated link.
IF $link parameter not sent (send empty string) that create link to same page.
IF $lang parameter not sent that create link to current language.
Examples:
<a href="<?php echo logaty()->link->create('', $language_code) ?>">My Link</a>
// real example
<a href="<?php echo logaty()->link->create('', 'en') ?>">this page in english language</a>
Generate Link to other Page with selected language
<a href="<?php echo logaty()->link->create('my_link') ?>">
<?php logaty()->__("My Link")?>
</a>
// real example
<a href="<?php echo logaty()->link->create('/about_me') ?>">
<?php logaty()->__("Go to About me Page in selected Language")?>
</a>
Generate Link to other Page with forced language
<a href="<?php echo logaty()->link->create('my_link', 'lang-code') ?>">
<?php logaty()->__("My Link")?>
</a>
// real example
<a href="<?php echo logaty()->link->create('/about_me', 'ar') ?>">
<?php logaty()->__("Go to About me Page in Arabic Language")?>
</a>