I have:
- 2 domains
- single database
- Single codebase
- single form with a text-editor and submit button.
What I want is the recognition of domain at database level. So, let's say if I hit http://example.com/en it should save in db with table T1 and if I hit http://example.fr/en it should also save in same db but with different table T2.
And now when I will fetch default value from table T1, it should only reflect to http://example.com/en and similarly for T2 it goes here - http://example.fr/en.
But because of same database and code base of both domains it is difficult to know from which domain the request is coming.
I have 1 solution is like create a table in .install
file by considering global $base_url;
and then check if table name = $base_url.my_table
exists, fetch all results.But I'm not sure it's the best approach in Drupal 8 or some other way to achieve this.
Please share best approach for this.