Maybe add more instructions on how to get the needed key from state in a custom module

Created on 13 December 2024, 9 days ago

The description of the module is overall great, but I would suggest adding more instruction on how to get received exchange rate values from state.

1. After you install the module go to Configurations and run cron (since it runs every 3 hours by default) to get the initial exchange rates data.
2. If you want to access the rates data somewhere inside your custom module use

$val = \Drupal::state()->get('rcr.eur_russia');

If the keys are not to be changed then maybe its ok to list them in the docs. Otherwise, the second step could be "access your database and find the needed keys (which contain "rcr") in the key_value table".

Maybe this is too basic, but I spent some time finding out how to retrieve the data from the state.

Feature request
Status

Active

Version

2.0

Component

Default

Created by

🇷🇺Russia andreiguk St Petersburg

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024