Using Yii2 framework I cannot find any built-in functionality to implement something called nested resources
in Ruby on Rails (http://guides.rubyonrails.org/routing.html#nested-resources)
For example, an Article has many Comments. So I want that comments related to an article will be accessed via /articles/1/comments
URL when index
action is used; via /articles/1/comments/create
when create
action is used and so on...
Do I have to add multiple action-methods to ArticlesController called actionIndexComments(), actionCreateComment()...
?
Or should I pass an ?article_id=1
parameter via GET and use it for filtering in CommentsController ?
Or should I maybe implement custom UrlManager
class that can deal with nested routes? (maybe someone has already implemented it?)
What is the best practice for now?