Skip to content

Conversation

@sapatevaibhav
Copy link
Collaborator

Installation

  1. Download and place the vaibhav_state_api module in your Drupal site's modules/custom directory.
  2. Enable the module using the following Drush command:
    drush en vaibhav_state_api
    Or enable it through the Drupal admin interface.

Usage

  • Navigate to the demo page provided by the module at /admin/states.
  • Use the provided links to set a new value or delete the current value stored in the state.

@sapatevaibhav sapatevaibhav self-assigned this Mar 24, 2025
* category = "custom_states"
* )
*/
class CustomState extends PluginBase implements StateInterface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sapatevaibhav , Why do we need this custom state manager, can't we do this using Drupal's State API?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By doing this we can keep these state values separate from Drupal's core state system database.
@omkar-pd should I use Drupal's State API?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally we use Drupal's State API. But as you've created custom state manager lets keep this.

@sapatevaibhav sapatevaibhav requested a review from omkar-pd April 17, 2025 05:12
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

Successfully merging this pull request may close these issues.

3 participants