Answer the question
In order to leave comments, you need to log in
How to make a frontend for a simple CMS?
There is a ready-made backend, there are services for extracting various content.
The task is to write a flexible frontend to display this content.
That is, calling urls like
/news
/My-First-Post
/Product/T-Shirt-white
/Company/About-Us
should extract some then the content and pass the necessary variables to the view,
map the url to the controller action and pull the methods of the services making the selections there (like I have now) I’m starting to dislike
the approach of the doctrine
public function(Post $post) {
}
# routing.yml
single_post:
route: /someregex
defaults:
_controller: viewcontroller:index
template: singlepost.html.twig
fetch: [ postContent ]
post_with_children:
route: /someregex
defaults:
_controller: viewcontroller:index
template: post_with_children.html.twig
fetch: [ postContent, postChildren ]
news:
route: /someregex
defaults:
_controller: viewcontroller:index
template: news.html.twig
fetch: [ lastNews ]
home:
route: /someregex
defaults:
_controller: viewcontroller:index
template: news.html.twig
fetch: [ lastTreeNews, newProducts, homePostContent ]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question