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 to pass Configure variables from PHP --> JS #38

Closed
impronta48 opened this issue Feb 13, 2022 · 3 comments
Closed

How to pass Configure variables from PHP --> JS #38

impronta48 opened this issue Feb 13, 2022 · 3 comments
Labels
question Further information is requested

Comments

@impronta48
Copy link

Hi,
is there a way to pass my configuration variables from PHP to JS?
For example: application logo, email, url, etc
Where should we store SPA configurations? (Like in .env files)

Thanks
Massimo

@ishanvyas22 ishanvyas22 added the question Further information is requested label Feb 13, 2022
@ishanvyas22
Copy link
Owner

Hey @impronta48, you can create a dedicated API endpoint which returns a list of configuration variables that you require. This can be called from a component(i.e. Sidebar.vue, Header.vue, etc.), which can be used by other components. You can also cache this API endpoint according to your needs, since changes in these values are not very often.

There might be better way than this but this is what I would suggest.

@github-actions
Copy link

github-actions bot commented Aug 2, 2022

This issue is stale because it has been open for 120 days with no activity. Remove the stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the stale label Aug 2, 2022
@ishanvyas22
Copy link
Owner

Closing this issue due to inactivity. Please respond here if you want to reopen this.

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

No branches or pull requests

2 participants