Why are we saying SLUG = FALSE? |
The default for slug is FALSE, which means if no slug is passed into the method, it will still be FALSE, which makes the code retrieve ALL articles. If a slug is passed in, like http://yoursite/get_news/some-slug, then it will retrieve the INDIVIDUAL article with the slug that equals "some-slug".
So if you went to: http://yoursite/get_news it would retrieve all articles because there is no slug provided If you go to: http://yoursite/get_news/some-slug it would retrieve the article with the slug of "some-slug" Kills 2 birds with one stone, so to speak. |
Messages In This Thread |
Why are we saying SLUG = FALSE? - by lexxtoronto - 03-18-2015, 01:12 PM
RE: Why are we saying SLUG = FALSE? - by mwhitney - 03-18-2015, 01:25 PM
RE: Why are we saying SLUG = FALSE? - by lexxtoronto - 03-18-2015, 01:55 PM
RE: Why are we saying SLUG = FALSE? - by CroNiX - 03-18-2015, 02:27 PM
RE: Why are we saying SLUG = FALSE? - by lexxtoronto - 03-18-2015, 06:17 PM
RE: Why are we saying SLUG = FALSE? - by mwhitney - 03-19-2015, 08:01 AM
RE: Why are we saying SLUG = FALSE? - by lexxtoronto - 04-08-2015, 06:07 PM
|