PHP code example of gephart / language

1. Go to this page and download the library: Download gephart/language 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/ */

    

gephart / language example snippets


$container = new \Gephart\DependencyInjection\Container();

/** @var \Gephart\Configuration\Configuration $configuration */
$configuration = $container->get(\Gephart\Configuration\Configuration::class);
$configuration->setDirectory(__DIR__ . "/config");

$language = $container->get(\Gephart\Language\Language::class);

echo $language->get(); // cs (fallback)

$language->set("en");
echo $language->get(); // en