# |
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 |
# |
Mar 11th 2018, 04:37 |
ricksaccous |
if it's easy enough |
# |
Mar 11th 2018, 04:37 |
ricksaccous |
but maybe i could switch over production servers later |
# |
Mar 11th 2018, 04:37 |
savant |
heh ok |
# |
Mar 11th 2018, 04:37 |
ricksaccous |
i'm going to look into your solution but first going to fix up some stuff, like the permissions mess and such, haha, kind of want to soft launch this site soon, as in a couple days |
# |
Mar 11th 2018, 04:31 |
ricksaccous |
ok |
# |
Mar 11th 2018, 04:31 |
savant |
yes |
# |
Mar 11th 2018, 04:31 |
ricksaccous |
should i just make all files owned by the group user? |
# |
Mar 11th 2018, 04:30 |
ricksaccous |
yeah |
# |
Mar 11th 2018, 04:30 |
savant |
maybe some file is owned by root or something. |