We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Return value of lang() must be of the type string, array returned" this is the error I got when I was trying to access language with list array as per example https://codeigniter4.github.io/CodeIgniter4/outgoing/localization.html#nested-arrays
Language/en/Login.php
`return [ 'list' => [ // Heading 'heading_title' => 'User', // Text 'text_success' => 'Success: You have modified attributes!', 'text_list' => 'User List', 'text_add' => 'Add User', 'text_edit' => 'Edit User', // Column 'column_name' => 'User Name', 'column_attribute_group' => 'User Group', 'column_sort_order' => 'Sort Order', 'column_action' => 'Action', // Entry 'entry_name' => 'User Name', 'entry_attribute_group' => 'User Group', 'entry_sort_order' => 'Sort Order', // Error 'error_permission' => 'Warning: You do not have permission to modify attributes!', 'error_attribute_group' => 'User Group Required!', 'error_name' => 'User Name must be between 1 and 64 characters!', 'error_product' => 'Warning: This attribute cannot be deleted as it is currently assigned to %s products!', ] ];`
I'm trying access all in one go to avoid call lang function again and again.
In Controller
$data['lang_list_array'] = lang('Login.list', [], 'en');
The Result I got is "Return value of lang() must be of the type string, array returned". Is it a bug or error on my side, what mistake did I made?
I also tried this from documentation but it also didn't work
return [ 'list' => [ 'Apples', 'Bananas', 'Grapes', 'Lemons', 'Oranges', 'Strawberries' ] ];
CodeIgniter 4 version v4.0.0-beta-3
Context
The text was updated successfully, but these errors were encountered:
Release 4.0.0-beta.4
3425790
lang() can indeed return an array. Examples in the website2 repo.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
"Return value of lang() must be of the type string, array returned" this is the error I got when I was trying to access language with list array as per example https://codeigniter4.github.io/CodeIgniter4/outgoing/localization.html#nested-arrays
Language/en/Login.php
I'm trying access all in one go to avoid call lang function again and again.
In Controller
The Result I got is "Return value of lang() must be of the type string, array returned". Is it a bug or error on my side, what mistake did I made?
I also tried this from documentation but it also didn't work
CodeIgniter 4 version
v4.0.0-beta-3
Context
The text was updated successfully, but these errors were encountered: