# |
Jun 29th 2018, 13:55 |
josbeir |
but if you dont need dynamic routes but some hardcoded routes specifically for 1 domain you can use the _host param |
# |
Jun 29th 2018, 13:55 |
josbeir |
'dynamic' routes can be added in your middleware |
# |
Jun 29th 2018, 13:55 |
josbeir |
normal shared routes can be defined in your routes.php file, no need to add _host etc, they will just work on all domains |
# |
Jun 29th 2018, 13:54 |
itmpls |
for example, nebraska.domain.com, miami.domain.com .. same template/theme, just different subdomain |
# |
Jun 29th 2018, 13:54 |
itmpls |
they'll be using the same template/theme, i dont need custom routes for each section |
# |
Jun 29th 2018, 13:54 |
itmpls |
it'll probably just be within 1 plugin |
# |
Jun 29th 2018, 13:53 |
itmpls |
oh and the routes.. haven't configured that yet |
# |
Jun 29th 2018, 13:53 |
itmpls |
there's 1 primary domain but many subdomains |
# |
Jun 29th 2018, 13:53 |
itmpls |
and i'm already validating them in the middleware |
# |
Jun 29th 2018, 13:53 |
josbeir |
and the routes for that domain ? |
# |
Jun 29th 2018, 13:53 |
itmpls |
yeah, the subdomains are stored in a table |
# |
Jun 29th 2018, 13:53 |
josbeir |
you have your domain specific routes stored in a db right? |
# |
Jun 29th 2018, 13:52 |
josbeir |
there are a few ways |
# |
Jun 29th 2018, 13:51 |
josbeir |
check out the routing middleware |
# |
Jun 29th 2018, 13:51 |
itmpls |
you mean not in config/routes? |
# |
Jun 29th 2018, 13:50 |
itmpls |
i'm just not understanding how i'd "load up routes for that site dynamically" though - haven't messed much with custom routes or middleware in cake |
# |
Jun 29th 2018, 13:50 |
josbeir |
:) |
# |
Jun 29th 2018, 13:49 |
lorenzo |
@josbeir brave guy |
# |
Jun 29th 2018, 13:48 |
josbeir |
if you load then from a db its not needed |
# |
Jun 29th 2018, 13:48 |
josbeir |
the host param seems more of af hardcoded solution |
# |
Jun 29th 2018, 13:48 |
josbeir |
if a site is detected in your middleware, load up routes for that site dynamically, no host needed then |
# |
Jun 29th 2018, 13:47 |
josbeir |
@itmpls i would just pass in the matched hostname in your dynamtic routes like we talked before |
# |
Jun 29th 2018, 13:46 |
josbeir |
:,( |
# |
Jun 29th 2018, 13:45 |
josbeir |
i'm clearing the path for you by 1 year @lorenzo |
# |
Jun 29th 2018, 13:44 |
itmpls |
i.e. Router::scope('/', ['_host' > '*.domain.com'], function($routes) { $routes->connect('/', [], 'routeClass' => 'foo' ] ) } ); vs Router::scope('/', ['prefix' => $prefix], function($routes) { $routes->fallbacks('Subdomain.Route'); } ); |
# |
Jun 29th 2018, 13:36 |
lorenzo |
it’s actually great :slightly_smiling_face: |
# |
Jun 29th 2018, 13:35 |
itmpls |
question.. i'm doing subdomain routing and to register the custom route class it seems like I can either do it by a wildcard host or the prefix. cakephp-subdomains plugin uses the prefix, but why vs the host? |
# |
Jun 29th 2018, 13:33 |
itmpls |
it isn't so bad, right?? :slightly_smiling_face: |
# |
Jun 29th 2018, 13:33 |
itmpls |
haha |
# |
Jun 29th 2018, 13:33 |
itmpls |
and by that i mean the 30 club |
# |
Jun 29th 2018, 13:33 |
lorenzo |
nice! |
# |
Jun 29th 2018, 13:31 |
itmpls |
oh man |
# |
Jun 29th 2018, 13:31 |
itmpls |
nice. i'm going to join you soon. 29 now, couple days |
# |
Jun 29th 2018, 13:31 |
itmpls |
ah |
# |
Jun 29th 2018, 13:31 |
lorenzo |
33 |
# |
Jun 29th 2018, 13:30 |
itmpls |
@lorenzo how old are you now |
# |
Jun 29th 2018, 13:20 |
lorenzo |
thanks medes |
# |
Jun 29th 2018, 13:14 |
itmpls |
happy bday @lorenzo |
# |
Jun 29th 2018, 13:09 |
jhob |
just reading up on anonymous functions in PHP docs now! :slightly_smiling_face: |
# |
Jun 29th 2018, 12:58 |
josbeir |
now you are! ;) |
# |
Jun 29th 2018, 12:54 |
jhob |
thanks, wasn't familiar with the use syntax :slightly_smiling_face: |