# |
Feb 18th 2020, 03:48 |
francisdoydora |
thank you, so safe to assume I can remove toArray() :) |
# |
Feb 18th 2020, 03:47 |
challgren |
@francisdoydora kind of https://github.com/cakephp/cakephp/blob/master/src/ORM/Table.php#L1362 |
# |
Feb 18th 2020, 03:08 |
francisdoydora |
```->find('list', ['limit' => 200])``` |
# |
Feb 18th 2020, 02:37 |
latenal |
The psr-6 is a doesn’t have publishing to a channel |
# |
Feb 18th 2020, 02:18 |
latenal |
Is there any doc or example? |
# |
Feb 18th 2020, 02:12 |
lpj145 |
you can configure redis and have a good way to use him. |
# |
Feb 18th 2020, 02:10 |
lpj145 |
@latenal cake have psr-6 yet. |
# |
Feb 18th 2020, 02:10 |
latenal |
Hi! Is there any redis plug-in? |
# |
Feb 17th 2020, 23:02 |
k4t |
\ o / |
# |
Feb 17th 2020, 23:02 |
k4t |
finally! I can go sleep! |
# |
Feb 17th 2020, 22:53 |
k4t |
thanks! |
# |
Feb 17th 2020, 22:50 |
k4t |
ok... that was it ;P |
# |
Feb 17th 2020, 22:46 |
ndm |
Oh I didn't really pay attention the first time. I'm not sure if additional route parameters are being included automatically, ie the slug. |
# |
Feb 17th 2020, 22:44 |
k4t |
@ndm https://gist.github.com/K4T/646b762ccfece46f5e3d6a45859e8741 |
# |
Feb 17th 2020, 22:41 |
k4t |
except these 2 |
# |
Feb 17th 2020, 22:40 |
k4t |
I will remove all routes |
# |
Feb 17th 2020, 22:40 |
ndm |
My first instinct would be that there's an additional route connected that catches your URL |
# |
Feb 17th 2020, 22:40 |
ndm |
Well, the initial problem is solved, now there's another one :) What other routes do you have connected? Ideally post all the routes and/or the `bin/cake routes` results |
# |
Feb 17th 2020, 22:37 |
k4t |
but problem still not solved, I am not getting: /my-editions/view?t=test |
# |
Feb 17th 2020, 22:36 |
k4t |
```public function match(array $url, array $context = []) { $match = parent::match($url, $context); return ($match) ? $match . '/' : false; }``` |
# |
Feb 17th 2020, 22:36 |
k4t |
Route class fixed: |
# |
Feb 17th 2020, 22:33 |
k4t |
ok |
# |
Feb 17th 2020, 22:31 |
ndm |
Hence I rest my case :) Fix that, and then go from there and fix the additional problems. |
# |
Feb 17th 2020, 22:30 |
ndm |
@k4t When your custom route is asked to do the matching, the first connected route will fail, as it doesn't match the `action`, but since you do not account for that case, and append `/` to whatever `parent::match()` returns, the matching will always be "successful" for the outside world, as the method will always return a string (`false . '/'` equals `/`). |
# |
Feb 17th 2020, 22:26 |
challgren |
Im just throwing ideas out at this time |
# |
Feb 17th 2020, 22:26 |
challgren |
Kind of how the pages example is https://github.com/cakephp/app/blob/master/config/routes.php#L70 |
# |
Feb 17th 2020, 22:26 |
challgren |
What about replacing the slug with *? |
# |
Feb 17th 2020, 22:25 |
ndm |
The route catching basically everything would be a perfect explanation for the behavior that you described |
# |
Feb 17th 2020, 22:25 |
ndm |
I'd say you probably have _additional_ problems, not that the route isn't responsible for the initial problem |
# |
Feb 17th 2020, 22:25 |
k4t |
well it will work, but to build correct parameters I will have to add a bit more logic to the code and I wanted to avoid that |
# |
Feb 17th 2020, 22:23 |
k4t |
I think that soething is wrong when request contain passed parameters (in my example this is slug) |
# |
Feb 17th 2020, 22:23 |
challgren |
Ok since you used a _name what about using that in the link? |
# |
Feb 17th 2020, 22:22 |
k4t |
but generally u r right, I should add logic for "false" |
# |
Feb 17th 2020, 22:21 |
k4t |
url is still generated wrong |
# |
Feb 17th 2020, 22:21 |
k4t |
and I think this is not the problem here, as when I remove my custom Route class from routes |
# |
Feb 17th 2020, 22:21 |
k4t |
with one exception - it will add '/' at the end |
# |
Feb 17th 2020, 22:21 |
k4t |
my route should do exactly what CakePhP DashedRoute is doing |
# |
Feb 17th 2020, 22:18 |
ndm |
@k4t You do not account for non-matching URLs, `parent::match()` can return `false` |
# |
Feb 17th 2020, 22:17 |
k4t |
looks like I have to build urls manually ;/ |
# |
Feb 17th 2020, 22:16 |
ndm |
Well, I don't know what to say about that, I'd have to dig up the discussion in Github. Looking at how `Router::parseRequest()` and `Router::reverseToArray()` return the query arguments in `?`, I'm not sure if I should trust the docs. |
# |
Feb 17th 2020, 22:11 |
challgren |
@ndm “Router will also convert any unknown parameters in a routing array to querystring parameters. The ? is offered for backwards compatibility with older versions of CakePHP.” |