# |
Mar 11th 2018, 05:42 |
ricksaccous |
i forgot a lot about routing, lol |
# |
Mar 11th 2018, 05:41 |
joddit |
Just going for brevity |
# |
Mar 11th 2018, 05:41 |
ricksaccous |
i think you have to do something with passed params for the routes |
# |
Mar 11th 2018, 05:41 |
savant |
~tell joddit about gist |
# |
Mar 11th 2018, 05:41 |
savant |
can you gist your entire routes.php file? |
# |
Mar 11th 2018, 05:41 |
joddit |
I mean there's nothing directly bad about having it in there |
# |
Mar 11th 2018, 05:40 |
ricksaccous |
oh i see |
# |
Mar 11th 2018, 05:40 |
savant |
thats interesting |
# |
Mar 11th 2018, 05:40 |
joddit |
I don't want the action name in the URL |
# |
Mar 11th 2018, 05:40 |
ricksaccous |
nice |
# |
Mar 11th 2018, 05:40 |
joddit |
When I did what savant suggested, it created a link like /articles/view/(category_name)/(article_slug) |
# |
Mar 11th 2018, 05:40 |
ricksaccous |
['controller'=>'Articles', 'action' => 'view', 'category-slug', 'article-slug'] |
# |
Mar 11th 2018, 05:39 |
ricksaccous |
or you could just have the action take in two params, and pass those params in |
# |
Mar 11th 2018, 05:39 |
joddit |
Thanks ill read about that |
# |
Mar 11th 2018, 05:39 |
savant |
which will return the above sort of stuff |
# |
Mar 11th 2018, 05:39 |
joddit |
Ok and thats what I figured, but it put view in the url |
# |
Mar 11th 2018, 05:39 |
savant |
I generally add a getRoute() method to my entity |
# |
Mar 11th 2018, 05:38 |
savant |
['controller' =>'Articles', 'action' => 'view', 'category' => 'your-category', 'slug' => 'your-slug'] |
# |
Mar 11th 2018, 05:38 |
joddit |
For this particular site, categories are only one level deep, no categories withint categories |
# |
Mar 11th 2018, 05:38 |
savant |
The route array for Html::link() would be |
# |
Mar 11th 2018, 05:38 |
ricksaccous |
ummm |
# |
Mar 11th 2018, 05:38 |
joddit |
Unless you recommend something more correct |
# |
Mar 11th 2018, 05:37 |
joddit |
Just using something simple like $routes->connect('/articles/:category/:slug', ['controller' => 'Articles', 'action' => 'view']); |
# |
Mar 11th 2018, 05:37 |
ricksaccous |
savant will save you |
# |
Mar 11th 2018, 05:36 |
savant |
no worries |
# |
Mar 11th 2018, 05:36 |
joddit |
Yeah sorry I DC'd accidentally if I missed your response |
# |
Mar 11th 2018, 05:36 |
savant |
If you're asking about the slug routing, can you gist your article routes? I can then show you how to build the Html::link() calls |
# |
Mar 11th 2018, 05:36 |
joddit |
Quick question, when creating links that don't follow the standard /controller/action/id kind of structure, do you just hand code them or am I missing something? |
# |
Mar 11th 2018, 05:35 |
savant |
hihihi |
# |
Mar 11th 2018, 05:35 |
savant |
barely anyone left |
# |
Mar 11th 2018, 05:35 |
savant |
nuclear war |
# |
Mar 11th 2018, 05:34 |
joddit |
Anyone alive at the moment? |
# |
Mar 11th 2018, 05:33 |
savant |
was going to answer him |
# |
Mar 11th 2018, 05:33 |
savant |
ah dang he left |
# |
Mar 11th 2018, 05:27 |
ReallyTallGuyBri |
when making custom URL's *** |
# |
Mar 11th 2018, 05:27 |
ReallyTallGuyBri |
I prefer to use $this->Html->link() to create links but it seems clunky when not making custom URL's |
# |
Mar 11th 2018, 05:26 |
ReallyTallGuyBri |
I have the routing out of the way, but do I now just hand code the URL's in views? Or is there some more "proper" way |
# |
Mar 11th 2018, 05:26 |
ReallyTallGuyBri |
Quick question, how does one institute slugs in an intelligent way in regard to creating links to deeper structures such as http://blah.com/articles/(category_name)/(article_slug) |
# |
Mar 11th 2018, 04:42 |
ricksaccous |
alright i will |
# |
Mar 11th 2018, 04:39 |
savant |
let me know if you have issues, im a maintainer of it. |
# |
Mar 11th 2018, 04:37 |
ricksaccous |
and i figure it out without too much trouble haha |