PHP code example of davispuh / fuelphp-lang

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

    

davispuh / fuelphp-lang example snippets


Autoloader::add_class('Lang', VENDORPATH . 'davispuh/fuelphp-lang/classes/lang.php');

Autoloader::add_class('Lang', APPPATH . 'classes/lang.php');



$languages = Config::get('languages');
unset($languages[0]);
$langs = implode('|', $languages);

return array(
'_root_' => 'welcome/index', // The default route
"({$langs})" => 'welcome/index', // The default route in other language
"(({$langs})/)?hello(/:name)?" => array('welcome/hello', 'name' => 'hello'),
);



$langs = implode('|', Config::get('languages'));

return array(
'_root_' => 'welcome/index', // The default route
"({$langs})" => 'welcome/index', // The default route in other language
"(({$langs})/)?hello(/:name)?" => array('welcome/hello', 'name' => 'hello'),
);
 echo Lang::localized('/blog/article/')