Welcome Guest, Not a member yet? Register   Sign In
How to change base config dynamic?
#3

(01-09-2019, 09:32 AM)titounnes Wrote: You can try like this.
Config('App')->foo = 'bar';

Or a bug, or I do not understand.
Lang added

[Image: lang.png]
app/congig/App.php
Code:
public $defaultLocale = 'en';
public $negotiateLocale = false;
public $supportedLocales = ['en', 'ru'];
 
in controller
Code:
public function index()
{
    
   Config('App')->negotiateLocale  = true;
   Config('App')->defaultLocale = 'ru';
       
       $data = array(
           'title' => 'Blog data array',
           'heading' =>  lang('app.secLine'),
       );
       
       echo view('header', $data);
       echo view('welcome', $data);
       echo view('footer', $data);
    
}

in views 
Code:
<?=  lang('app.firstLine');  ?>

With language file takes from the English.
Reply


Messages In This Thread
How to change base config dynamic? - by ramstudio - 01-09-2019, 12:15 AM
RE: How to change base config dynamic? - by ramstudio - 01-10-2019, 02:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB