# |
Sep 23rd 2019, 15:26 |
daniel.upshaw |
For example, maybe there's another controller with a map of redirects |
# |
Sep 23rd 2019, 15:25 |
daniel.upshaw |
You might return a 404 response if there's no match.... *but*.... what if you want to continue routing? |
# |
Sep 23rd 2019, 15:25 |
daniel.upshaw |
@ckjksl good question. So, for example, say you have a controller that pulls content from the database, if it finds a matching path, it returns a response |
# |
Sep 23rd 2019, 15:24 |
ckjksl |
I'm wondering, what are all the possible reasons why a matching route might not have a response? |
# |
Sep 23rd 2019, 15:23 |
daniel.upshaw |
They're confusing, seems like there ought to be a way |
# |
Sep 23rd 2019, 15:23 |
daniel.upshaw |
Lol s'okay, me too pretty much |
# |
Sep 23rd 2019, 15:22 |
ricksaccous |
i dunno i'm bad with routes, lol |
# |
Sep 23rd 2019, 15:22 |
ricksaccous |
oh |
# |
Sep 23rd 2019, 15:22 |
daniel.upshaw |
It seems like it ought to be possible for more than one controller to check dynamic route paths |
# |
Sep 23rd 2019, 15:20 |
daniel.upshaw |
Well the outer function is `Router::scope('/', function...)` |
# |
Sep 23rd 2019, 15:20 |
daniel.upshaw |
Well see how this is scoped to `/*` @ricksaccous |
# |
Sep 23rd 2019, 15:20 |
daniel.upshaw |
Mmm |
# |
Sep 23rd 2019, 15:18 |
ricksaccous |
doesn't scoping solve this problem? |
# |
Sep 23rd 2019, 15:17 |
ckjksl |
if it's a very deep tree, or there are posts that are part of multiple trees, you might consider using a tag system |
# |
Sep 23rd 2019, 15:17 |
daniel.upshaw |
If you `return false` from a custom routing class, it does have that effect... but trying to figure out how to achieve something similar from a connected controller |
# |
Sep 23rd 2019, 15:16 |
ckjksl |
I'm doing something similar. It depends on how deep your tree goes. For me, my tree is only 1 deep guaranteed, so I just have a parent_id field. If parent_id is not empty, then I find everything that has the same parent_id, plus the actual parent_id item. |
# |
Sep 23rd 2019, 15:15 |
daniel.upshaw |
E.g., that'll catch everything, but say that controller doesn't have an appropriate response, but a route further down might |
# |
Sep 23rd 2019, 15:15 |
daniel.upshaw |
Trying to think of a good way to *continue routing* if the controller for the first matching route determines that it doesn't have a response: `$routes->connect('/*', ['controller' => 'Pages', 'action' => 'display']);` |
# |
Sep 23rd 2019, 15:11 |
ricksaccous |
nevermind i found an example here: http://mark-story.com/posts/view/introducing-the-cakephp-authorization-plugin |
# |
Sep 23rd 2019, 15:08 |
ricksaccous |
for policy scopes what would have to be done to actually apply the scope to the query in the index action https://book.cakephp.org/authorization/1.1/en/policies.html#policy-scopes |
# |
Sep 23rd 2019, 14:18 |
Guest87544 |
Hi All, how can I get posts with term parent id where they are related to categories with a treebehavior. Example: I would found all posts using the A term id where there is some posts related to a term B (B is a child of A). |
# |
Sep 23rd 2019, 13:31 |
ricksaccous |
oh alright |
# |
Sep 23rd 2019, 13:30 |
marek.sebera |
@ricksaccous yes, but the config provided classes need to subclass (extend) correct ones from the CORE, which should be those I named |
# |
Sep 23rd 2019, 13:29 |
ricksaccous |
can't you specify your own classes in the config so you don't necessarily have to over-ride but can create your own? |
# |
Sep 23rd 2019, 13:28 |
marek.sebera |
Hi, if I want to log exceptions/errors within DB but want to save along some context (such as form data, url, user auth details), i need to override both ExceptionRenderer and BaseLog, is that right? |
# |
Sep 23rd 2019, 13:27 |
alexdd55976 |
on the other hand, it was perfect with customers... |
# |
Sep 23rd 2019, 13:25 |
ricksaccous |
by the way, i grabbed mcdonalds in your car and found your secret bossman |
# |
Sep 23rd 2019, 13:24 |
alexdd55976 |
@ricksaccous super weird. but was fun that he didn't understand why he lost all his stupid discussions. |
# |
Sep 23rd 2019, 13:23 |
itmpls |
oh |
# |
Sep 23rd 2019, 13:23 |
ricksaccous |
is my guess |
# |
Sep 23rd 2019, 13:23 |
ricksaccous |
it won't recognize the actual table as it's being aliased in the query |
# |
Sep 23rd 2019, 13:23 |
ricksaccous |
SubmissionUsers.user_id |
# |
Sep 23rd 2019, 13:23 |
ricksaccous |
I think you have to name the field like |
# |
Sep 23rd 2019, 13:23 |
itmpls |
is it the hydration logic? |
# |
Sep 23rd 2019, 13:23 |
itmpls |
Why is Cake not selecting my `GROUP_CONCAT(submissions_users.user_id)` column when I a `leftJoinWith('SubmissionsUsers')`? In debugKit, the SQL tab I copy *does* show that group_concat column in my sql program |
# |
Sep 23rd 2019, 13:22 |
ricksaccous |
man that's pretty weird |
# |
Sep 23rd 2019, 13:22 |
alexdd55976 |
i was in advertising those days and he was CEO/CTO |
# |
Sep 23rd 2019, 13:22 |
ricksaccous |
ahahaha |
# |
Sep 23rd 2019, 13:22 |
alexdd55976 |
yes, and how you turn the tables, that at the end you are always right. |
# |
Sep 23rd 2019, 13:21 |
alexdd55976 |
i like showing what i already created, no problem... the code is not important then, because its the last thing you do |
# |
Sep 23rd 2019, 13:21 |
ricksaccous |
in his car he had a CD that explained how to control conversations? |