Posts

Showing posts with the label Controller

Controllers for Resources, Services and Web Pages in a Symfony Application

The controller processes the request and returns a response. Actions for resource controllers, services, and web pages make up the way you interact with application. Resource A resource is an entity that stores data. For example, news, product, order, article, comment. Also, the resource is a list of all units of this entity. Main actions on the resource: Creation (adding to the list) Receiving Editing Removal Resource API example: GET /api/catalog/products/30004 # getting the resource "Product" by identifier "30004" POST /api/blog/articles # creating an "Article" resource with data in the body of the POST request DELETE /api/blog/comments/1250 # delete resource "Comment" with id "1250" The segments catalog and blog in the URLs mean that the resources belong to a specific domain and can be separated into the appropriate bundles. For example, the domain-specific resources of a catalog can be Product , ...