Skip to content
New issue

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

How I get config data in frontend? #2080

Closed
testt23 opened this issue Mar 25, 2021 · 5 comments
Closed

How I get config data in frontend? #2080

testt23 opened this issue Mar 25, 2021 · 5 comments

Comments

@testt23
Copy link
Contributor

testt23 commented Mar 25, 2021

Congratulations on still maintaining and upgrading this wonderful system for us! I have the following problem. In the administrative panel I create additional settings in the “Config” module: address, phone

I’m trying to get them in the frontend part like this: however, the whole site “bugs” and gives an error. I need it so that I can correct it in case of a change of company address or company phone number. Since such options are missing in CMS Settings, I decided that it might be done through the Config module … but unfortunately it does not work.

Thanks for helping me.

LUYA Check ouput (run this script and post the result: luyacheck.php)

Additional infos

Q A
LUYA Version last
PHP Version 7.4
Platform Apache/XAMPP/MAMPP/etc.
Operating system Windows/Linux Server/OSX/etc.
@nadar
Copy link
Member

nadar commented Mar 25, 2021

Ensure you are using the correct model in the frontend: https://luya.io/api/luya-admin-models-Config (there are mulitple config models... sadly)

using Config::get('') definitely works, because we are using this often too. Ensure you are on the latest luya versions for cms and admin. if it still does not work you have to provide more informations like stack trace and screenshot.

@nadar
Copy link
Member

nadar commented Mar 25, 2021

and yes, the Config section in the admin area is definitely a good place for such global environment settings, and accessing those config with \luya\admin\models\Config::get('youridentifier') 👍

@testt23
Copy link
Contributor Author

testt23 commented Mar 25, 2021

@nadar this is working correctly:

Thanks very much. I have add translate for Bulgarian users, review and approve them if you wish. :)

Thanks +1

@nadar
Copy link
Member

nadar commented Mar 25, 2021

sure, please send us a pull request 👍

@nadar nadar closed this as completed Mar 25, 2021
@testt23
Copy link
Contributor Author

testt23 commented Mar 25, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants