• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
setFlashData Always Return EN Value

#1
Hi,

I just want to ask question about flashData. I was upgrade my codeigniter base 4.0.2 to 4.0.3 and i faced that stuation.

My language properties are, 
Code:
public $negotiateLocale = TRUE;
public $supportedLocales = ['tr', 'en', 'fr'];

setting flashData
Code:
$check['status']
     ? \Config\Services::session()->setFlashdata('success', lang('FlashMessageType.success.general'))
     : \Config\Services::session()->setFlashdata('error', 'lang('FlashMessageType.error.custom'));

View page, 
Code:
<?php if(Services::session()->getFlashdata('success')): ?>
    <p><?php echo lang('Home.try'); ?></p>
    <div class="alert_message green"><p><?php echo \Config\Services::session()->getFlashdata('success'); ?></p></div>
<?php else: ?>

I added some lang parameters for debug. Only lang parameters works correct. But flashData parameters are incorrect. I haven't any idea what couse that problem. 

Any idea for debugging that problem or solving that problem would be great. Thanks

Sorry for my Engilish, its not my native.

It's my mistake. I was read changelog but i misunderstand some information.

https://github.com/codeigniter4/CodeIgniter4/releases
"Added the ability to have nested language defintions."

My all language files based on that rule. After upgrade system nested language definitions are effected by system Smile 
After changing my language files,

Code:
return [
'success.general' => 'Success',
];
to
Code:
return [
'success-general' => 'Success',
];

works perfectly.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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