Configuration - Logaty

Configuration files Last updated: 26/12/2021

Find Config Files, Click on file to see content.

  • Config
    • options.php General Settings.
    • direction.php languages direction (ltr or rtl).
    • enabled.php enabled languages in your website.
    • flags.php language flag name (icon name en.png).
    • name.php Language Name ( Name in English & Natural Name ).
    • supported.php all languages supported in your website.
    • paths.php directory paths of (languages directory & flags directory).
    • code.php languages ISO-2 Codes - optional if you want to use it.

Get configuration values

How to use Configuration its easy to get configuration values!


    // get default language
    echo logaty()->config->get('options.default_lang');

    // get direction for arabic language
    echo logaty()->config->get('');

All options in (options.php) file you can retrieve value using options helper function


    // get default language
    echo logaty()->option('default_lang');

    // check if detecting browser language is enabled
    if( logaty()->option('detect_browser_lang')
        echo "Yes";
        echo "NO";

You can get configuration using Helpers

     // return -Array- All enabled languages
     // check if english language is enabled return -Bool-

     // get english language direction return -string (rtl, ltr)-

Create Your Own Configuration

you can create extra configurations if your application (website) need

  • Create Config File

    inside LOGATY directory go to -/config/- directory
    & create php file called what you want.

    for example I will create file called extra.php

        return [
            // languages we a help hand to translate website to 
            'need-to-trans' => [
                'ar', 'es'
            'foo' => 'bar'
  • retrieve config

    get values fro your extra config

    this code will return an array
    array : ar, es
    this code will return string
    string : bar