如何设计RESTful 通过tags和分类 获取文章列表?

WBOY
Release: 2016-06-06 20:49:24
Original
1098 people have browsed it

例如正常的 get /api/articles/ 所有文章 get /api/articles/id 通过文章ID获取单个文章

那么如何通过tags 例如要做一个getArticleByTags 的接口如何设计, 注意可以是多个tag调用文章.

还要结合文章分类调用 就是 getArticleByTagsByCategory,

不知道RESTful 如何设计,
PHP框架使用laravel3 ,最好能有代码 路由和控制器如何做

回复内容:

例如正常的 get /api/articles/ 所有文章 get /api/articles/id 通过文章ID获取单个文章

那么如何通过tags 例如要做一个getArticleByTags 的接口如何设计, 注意可以是多个tag调用文章.

还要结合文章分类调用 就是 getArticleByTagsByCategory,

不知道RESTful 如何设计,
PHP框架使用laravel3 ,最好能有代码 路由和控制器如何做

<code>GET /api/articles?tags=tag1,tag2&category=xxx
</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!