Log message #4154182

# At Username Text
# Jun 27th 2018, 11:20 neon1024 Although routing is parsed procedurally, so the first routing rule will always be hit first
# Jun 27th 2018, 11:19 neon1024 Then you can check that param in the controller
# Jun 27th 2018, 11:19 neon1024 The other way I can think of, is passing a param from the routing, which I do sometimes
# Jun 27th 2018, 11:18 neon1024 I would compile two custom finders in that method
# Jun 27th 2018, 11:18 neon1024 Personally I would route the url to a single action, and deal with it there
# Jun 27th 2018, 11:18 edgaras.jan here is cake 2 sample https://gist.github.com/gapple/4069038, cake3 looks very similar
# Jun 27th 2018, 11:14 edgaras.jan https://book.cakephp.org/3.0/en/development/routing.html#custom-route-classes
# Jun 27th 2018, 11:14 edgaras.jan you need custom SlugRoute class to match if `:slug` is author or tag
# Jun 27th 2018, 10:57 a.francazi if i go to /tagSlug it tries to find authorSlug and can't find it. I'd like to check it both for author and tag-slug, then open either author or tag page.
# Jun 27th 2018, 10:55 a.francazi File uploaded https://cakesf.slack.com/files/U7T7YBECA/FBFUBPPBR/-.php / https://slack-files.com/T053DPNCM-FBFUBPPBR-5bff78812f
# Jun 27th 2018, 10:54 a.francazi is there an easy way to have one route point to multiple actions?
# Jun 27th 2018, 10:19 josbeir ah you just typed that nm :P
# Jun 27th 2018, 10:19 josbeir @turkles array_keys($collection->toArray()) ?
# Jun 27th 2018, 10:10 turkles well.. array_keys($collection->toArray()) works.. eww
# Jun 27th 2018, 10:09 neon1024 Well it implements Iterator, so perhaps you could just do `array_keys($collection)` ?
# Jun 27th 2018, 10:06 turkles extract wants a path.. but I can see you can do a callback.. hrm
# Jun 27th 2018, 10:05 turkles my collection does.. it's come from json data and is in the form 123 => ['data' => 'blah, 'etc' => 'blah], 456 =>...
# Jun 27th 2018, 10:02 neon1024 https://book.cakephp.org/3.0/en/core-libraries/collections.html#Cake\Collection\Collection::extract
# Jun 27th 2018, 10:02 neon1024 Probably `extract()` I’d think
# Jun 27th 2018, 10:01 neon1024 Do they even have keys?
# Jun 27th 2018, 09:56 turkles Is there a quick way to get a list of keys in a collection?
# Jun 27th 2018, 09:37 neon1024 Also do check the execution time without debug on
# Jun 27th 2018, 09:37 itamer My pleasure @gs13006, nice to be able to help and be helped
# Jun 27th 2018, 09:36 gs13006 @itamer thankyou very much
# Jun 27th 2018, 09:34 gs13006 Yes, i did it. may be i need to check this again.
# Jun 27th 2018, 09:34 itamer I run some massive queries, and they're fast - you will be able to fix this
# Jun 27th 2018, 09:33 itamer Once it's fast in the database, then you can look to see if there are any inefficiencies in your controller and models
# Jun 27th 2018, 09:33 itamer use debug tools to get the query and see if you can get it running faster in phpMyAdmin or whatever tool you are using.
# Jun 27th 2018, 09:32 itamer and look at the table type - is it optimised for the type of data you have
# Jun 27th 2018, 09:32 itamer look at your indexes in the database
# Jun 27th 2018, 09:32 itamer consider unbinding those tables if the data isn't needed
# Jun 27th 2018, 09:31 itamer Have a look at your recursive value - cut that down
# Jun 27th 2018, 09:31 gs13006 yes it is associated with each other.
# Jun 27th 2018, 09:31 itamer do you need those extra tables loaded every time?
# Jun 27th 2018, 09:31 gs13006 2x
# Jun 27th 2018, 09:30 itamer what version of cake @gs13006?
# Jun 27th 2018, 09:30 gs13006 @itamer I'm running a cakephp website, i have user table and the user table is related with more then 3 table. when i tried to open this it will always taking 20 sec. even i'm crated cache for this.
# Jun 27th 2018, 09:30 itamer thanks for your help @neon1024
# Jun 27th 2018, 09:25 itamer got it :slightly_smiling_face:
# Jun 27th 2018, 09:25 itamer ->Mtypes->name;
# Jun 27th 2018, 09:24 itamer What's the correct notation when it's a variable on a joined table?