# |
Oct 18th 2019, 16:00 |
neothermic |
Hmm, what's the earliest function in the request stack that I can hook into without altering core in cake3? :slightly_smiling_face: |
# |
Oct 18th 2019, 15:33 |
ricksaccous |
you might have to put regular expression patterns on all three article-type id and slug |
# |
Oct 18th 2019, 15:32 |
ricksaccous |
you don't have the "action" in there? |
# |
Oct 18th 2019, 15:32 |
ricksaccous |
so are all three params? |
# |
Oct 18th 2019, 15:31 |
ricksaccous |
i see |
# |
Oct 18th 2019, 15:30 |
daniel.upshaw |
If I change it to `'/data/:id/:slug'` it does match though |
# |
Oct 18th 2019, 15:30 |
ricksaccous |
oh |
# |
Oct 18th 2019, 15:30 |
ricksaccous |
that won't match cause it has 3 params |
# |
Oct 18th 2019, 15:30 |
daniel.upshaw |
`'/:article-type/:id/:slug'` is the attempted |
# |
Oct 18th 2019, 15:30 |
daniel.upshaw |
`/data/37/article-title` would be the URL |
# |
Oct 18th 2019, 15:29 |
ricksaccous |
or are you saying you get no matches unless the first part is static |
# |
Oct 18th 2019, 15:29 |
ricksaccous |
out of curiosity |
# |
Oct 18th 2019, 15:29 |
ricksaccous |
what doesn't match |
# |
Oct 18th 2019, 15:29 |
ricksaccous |
what url are you hitting that matches |
# |
Oct 18th 2019, 15:28 |
daniel.upshaw |
Maybe it needs `setPatterns()` in addition to `setPass()`, I'll check that |
# |
Oct 18th 2019, 15:28 |
daniel.upshaw |
But yeah, the structure of the current URL does match, and if I change the first part to static, it'll catch it |
# |
Oct 18th 2019, 15:27 |
daniel.upshaw |
They are tricky |
# |
Oct 18th 2019, 15:27 |
ricksaccous |
i am kind of bad with routes tbh |
# |
Oct 18th 2019, 15:27 |
ricksaccous |
also if you have anything other than /somepart/otherpart it won't match ie /somepart/secondpart/third or /somepart/secondpart? though actually i'm not sure how get requests are handled i think they might actually still match |
# |
Oct 18th 2019, 15:26 |
ricksaccous |
pretty sure it is, but you would still need the :id for it to match |
# |
Oct 18th 2019, 15:25 |
daniel.upshaw |
Just seems that using a param as the `/:first-path-part` isn't supported for custom routes, which seems really strange |
# |
Oct 18th 2019, 15:24 |
ricksaccous |
oh |
# |
Oct 18th 2019, 15:24 |
daniel.upshaw |
Also tried making it first, yep |
# |
Oct 18th 2019, 15:24 |
ricksaccous |
is this the first route? |
# |
Oct 18th 2019, 15:24 |
ricksaccous |
route order matters |
# |
Oct 18th 2019, 15:24 |
daniel.upshaw |
It ought to catch anything that comes in, but it only does if the first path part is static... which is what leads me to believe that it isn't supported otherwise |
# |
Oct 18th 2019, 15:23 |
daniel.upshaw |
@neon1024 It's actually a very preliminary idea, so all that it does in the custom route so far is: ``` public function parse($url, $method = '') { dd($url, $method); }``` |
# |
Oct 18th 2019, 15:09 |
ricksaccous |
in the templates |
# |
Oct 18th 2019, 15:09 |
ricksaccous |
but you shouldn't have to deal with namespaces |
# |
Oct 18th 2019, 15:08 |
ricksaccous |
the namespace is wrong |
# |
Oct 18th 2019, 15:08 |
ricksaccous |
just gist your actual view code |
# |
Oct 18th 2019, 15:08 |
bertinmendoza4 |
Now bigger error |
# |
Oct 18th 2019, 15:07 |
val |
Hi, what class/method is responsible for converting entity object to json? |
# |
Oct 18th 2019, 15:07 |
bertinmendoza4 |
haha thank |
# |
Oct 18th 2019, 15:06 |
ricksaccous |
not FromHelper |
# |
Oct 18th 2019, 15:06 |
ricksaccous |
it's called FormHelper |
# |
Oct 18th 2019, 15:05 |
bertinmendoza4 |
Method App\View\Helper\FromHelper::end does not exist [CORE/src/View/Helper.php, line 116] |
# |
Oct 18th 2019, 15:05 |
slackebot1 |
CORE/src/Http/Middleware/CsrfProtectionMiddleware.php, line 123 Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65 Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 51 Cake\Routing\Middleware\RoutingMiddleware::__invoke() - CORE/src/Routing/Middleware/RoutingMiddleware.php, line 168 Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65` |
# |
Oct 18th 2019, 15:05 |
slackebot1 |
Cake\Http\ActionDispatcher::_invoke() - CORE/src/Http/ActionDispatcher.php, line 126 Cake\Http\ActionDispatcher::dispatch() - CORE/src/Http/ActionDispatcher.php, line 94 Cake\Http\BaseApplication::__invoke() - CORE/src/Http/BaseApplication.php, line 234 Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65 Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65 Cake\Http\Middleware\CsrfProtectionMiddleware::__invoke() - |
# |
Oct 18th 2019, 15:05 |
bertinmendoza4 |
trying to add a form using `Cake\View\Helper::__call() - CORE/src/View/Helper.php, line 116 include - APP/Template/Users/login.ctp, line 9 Cake\View\View::_evaluate() - CORE/src/View/View.php, line 1418 Cake\View\View::_render() - CORE/src/View/View.php, line 1379 Cake\View\View::render() - CORE/src/View/View.php, line 879 Cake\Controller\Controller::render() - CORE/src/Controller/Controller.php, line 795 |
# |
Oct 18th 2019, 15:01 |
neon1024 |
If it’s not working and you are using a custom route class, it’s safe to assume it’s the custom route class |