• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change base config dynamic?

#3
(01-09-2019, 10: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, 01:15 AM
RE: How to change base config dynamic? - by ramstudio - 01-10-2019, 03:01 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.