mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:14:04 +00:00
UrlGenerator: set defaults based on config; request data: move config to config file+resolver
This commit is contained in:
parent
27685ffe5a
commit
bba649a33c
6 changed files with 139 additions and 33 deletions
|
|
@ -67,13 +67,15 @@ class UrlGeneratorBootstrapper implements TenancyBootstrapper
|
|||
$defaultParameters = $this->originalUrlGenerator->getDefaultParameters();
|
||||
|
||||
if (static::$addTenantParameterToDefaults) {
|
||||
$defaultParameters = array_merge(
|
||||
$defaultParameters,
|
||||
[
|
||||
PathTenantResolver::tenantParameterName() => PathTenantResolver::tenantParameterValue($tenant), // path identification
|
||||
'tenant' => $tenant->getTenantKey(), // query string identification
|
||||
],
|
||||
);
|
||||
$defaultParameters = array_merge($defaultParameters, [
|
||||
PathTenantResolver::tenantParameterName() => PathTenantResolver::tenantParameterValue($tenant),
|
||||
]);
|
||||
|
||||
foreach (PathTenantResolver::allowedExtraModelColumns() as $column) {
|
||||
// todo0 should this be tenantParameterName() concatenated to :$column?
|
||||
// add tests
|
||||
$defaultParameters["tenant:$column"] = $tenant->getAttribute($column);
|
||||
}
|
||||
}
|
||||
|
||||
$newGenerator->defaults($defaultParameters);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue