1

We can describe the configuration variables in the *.schema.yml files but there is a place to describe the State API variables?

I searched in the Core for some State variables and I don't find a description of them. And I searched in the State API docs without luck.

For the moment I add a comment explaining the variable where I set the value but maybe this is not the best approach for it.

  • as per drupal.org/docs/8/api/state-api/overview - not really but if it is mission critical perhaps good old fashion hook_install or could make a config/optional/mymodule.state.yml then in hook_install phrase the file and set the state ? if not perhaps change to use configfactory – Taggart Jensen Sep 7 at 2:32
  • This really just comes down to documentation. I generally put such documentation in either a README, or in the comments for the .module file. – Jaypan Sep 7 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.