Hi,
I was trying to load routes dynamically from a db. But that is not working.
When I tried this , my web page is taking ages to load and getting below warning
But everything is fine in php.ini file. So how to load routes dynamically ?
Thanks
Siri K
How to load routes dynamically to custom_routes.php
2 years ago
2 years ago
#1
2 years ago
#2
Hi Simon,
Can you please look into this?
Thanks
Siri K
Can you please look into this?
Thanks
Siri K
2 years ago
#3
Gee Siri, I looked at this post a few days ago and it was making my head hurt ???
You haven't given me much to go on - except a lot of me assuming what the f@rk is he trying to do here...
1. Assuming you are putting fetch_dynamic_routes() in custom_routing.php, just before it defines 'CUSTOM_ROUTES' replacing the $routes array?
• if so, it seems you're creating a loop with your cURL as you're calling an endpoint within your domain/app using $url = BASE_URL . 'static_pages/getroutes';. This might cause cURL to wait indefinitely until it times out.
2. It's crucial to understand the order in which things are loaded with Trongate.
• hint - follow the logic flow of index.php in the public folder
OK, now we have a better understanding of when things are loaded, I can now try and guess what you want.
3. I'm assuming you have created a module that creates dynamic routes?
• assuming your table looks like this
• and you have the standard routes already in there
4. Let's now create a file in public and call it dr.php
(the help bar won't let me paste in a require_once for ../ config / database.php so add it below)
5. Now alter `custom_routing.php' so it looks like this:
Cheers,
Si
Full post on the SCA forum
You haven't given me much to go on - except a lot of me assuming what the f@rk is he trying to do here...
1. Assuming you are putting fetch_dynamic_routes() in custom_routing.php, just before it defines 'CUSTOM_ROUTES' replacing the $routes array?
• if so, it seems you're creating a loop with your cURL as you're calling an endpoint within your domain/app using $url = BASE_URL . 'static_pages/getroutes';. This might cause cURL to wait indefinitely until it times out.
2. It's crucial to understand the order in which things are loaded with Trongate.
• hint - follow the logic flow of index.php in the public folder
OK, now we have a better understanding of when things are loaded, I can now try and guess what you want.
3. I'm assuming you have created a module that creates dynamic routes?
• assuming your table looks like this
• and you have the standard routes already in there
4. Let's now create a file in public and call it dr.php
(the help bar won't let me paste in a require_once for ../ config / database.php so add it below)
5. Now alter `custom_routing.php' so it looks like this:
Cheers,
Si
Full post on the SCA forum
2 years ago
#4
Hi Simon,
sorry for this and thank you, it is working .
Best Regards,
Siri K
sorry for this and thank you, it is working .
Best Regards,
Siri K