Log message #4155963

# At Username Text
# Jul 5th 2018, 12:00 josbeir and overriding _dynamicFinder() ?
# Jul 5th 2018, 12:00 neon1024 Next plan of attack!
# Jul 5th 2018, 12:00 neon1024 So I should be able to map the methods in my behaviour, all to the same method
# Jul 5th 2018, 11:59 neon1024 Yeah, using `__call` doesn’t work either. This is because the `callFinder()` method uses `method_exists` on the Table, and then uses the behaviours `hasFinder()` method, before throwing the exception. So the method is never actually called for the `__call` to catch
# Jul 5th 2018, 11:58 slackebot4 Action: josbeir hides
# Jul 5th 2018, 11:58 josbeir Diego_ I believe @admad has used this plugin x)x)x)
# Jul 5th 2018, 11:57 josbeir you should read up on all router methods, they come in handy from time to time :slightly_smiling_face:
# Jul 5th 2018, 11:57 josbeir Router::reverse($array)
# Jul 5th 2018, 11:57 Diego_ Hello, im trying to use this plugin (https://github.com/ADmad/cakephp-jwt-auth) to authenticate my test api controller actionbut im having some issues with function authenticate() not being called, have anyone used this plugin?
# Jul 5th 2018, 11:56 birdy247 then i can do an easy comparison
# Jul 5th 2018, 11:56 birdy247 is there a way to pass in an array and see the matched route?
# Jul 5th 2018, 11:56 birdy247 and tell me the matched route
# Jul 5th 2018, 11:56 birdy247 so that works well
# Jul 5th 2018, 11:56 birdy247 cool
# Jul 5th 2018, 11:56 josbeir or $this->request->here etc...
# Jul 5th 2018, 11:55 josbeir also @birdy247 => $this->getRequest()->getAttribute('here') can also be used to get the current url
# Jul 5th 2018, 11:53 josbeir :point_up:
# Jul 5th 2018, 11:53 admad @birdy247 router::parser() or reverseToArray()
# Jul 5th 2018, 11:52 josbeir you need Router::parse() then
# Jul 5th 2018, 11:52 josbeir oh my mistake
# Jul 5th 2018, 11:51 birdy247 dd(Router::normalize($this->request->getUri()->getPath()));
# Jul 5th 2018, 11:51 birdy247 @josbeir it seems to always return the string route?
# Jul 5th 2018, 11:49 neon1024 But as I’m in a behaviour I’m not extending the class, so I might have to move to a Trait
# Jul 5th 2018, 11:49 neon1024 I wondered if I could wrap, https://github.com/cakephp/cakephp/blob/master/src/ORM/Table.php#L2418-L2480
# Jul 5th 2018, 11:49 neon1024 But getting Cake to see the methods as a finder is proving tough for me :slightly_smiling_face:
# Jul 5th 2018, 11:48 neon1024 I’ve rolled a behaviour for the implementation
# Jul 5th 2018, 11:48 josbeir will convert a string route to an array
# Jul 5th 2018, 11:48 josbeir Router::normalize() @birdy247
# Jul 5th 2018, 11:48 neon1024 So I want a dynamic Status finder
# Jul 5th 2018, 11:48 neon1024 So I want to find Live users, but I want Pending scripts elsewhere for example
# Jul 5th 2018, 11:48 neon1024 It’s Status globally
# Jul 5th 2018, 11:47 admad Make your own authenticator :)
# Jul 5th 2018, 11:47 josbeir @birdy247 i believe Router has such methods
# Jul 5th 2018, 11:47 josbeir ok i was right :P
# Jul 5th 2018, 11:47 admad No :)
# Jul 5th 2018, 11:47 neon1024 @admad Will that work as a finder?
# Jul 5th 2018, 11:47 josbeir not sure, didn't read the entire question that good :)
# Jul 5th 2018, 11:47 josbeir indeed but i think the point is to use it in login ?
# Jul 5th 2018, 11:46 admad Don't need to override the magic method, just make a concrete method with your required signature
# Jul 5th 2018, 11:46 birdy247 Is there a neat way in cake to see if the current request matches a URL (cake array structure)
# Jul 5th 2018, 11:46 neon1024 Will give it a go, as I’m going to pretty much filter everything by status, so I’m more interested in the syntactic sugar than the api