D
D
dim4ik2013-11-29 20:51:21
Frameworks
dim4ik, 2013-11-29 20:51:21

What to choose ready-made solutions using the blitz template engine?

I decided to master blitz, but I don’t know how to tie it to a self-written MVC engine, because. It turns out that the blitz template engine needs its own template controller.
It turns out the model is not MVC, but MVC + Template Controller.
In my engine, the user request is processed as follows:
(for example, I will describe the news display page)
0. user request for a specific url
1. router class determines which controller to load -include_once controller/news_controller.php
1.1 and which method to call (does the loaded controller)
2. the news controller calls the model model/news_model.php to get the news data
3. the same controller defines the name of the template file templates/news/one_news.tmp
3.1 gives the data and the name of the template to the view
class 4. the view class inserts the data into the template
4.1 checks if there are additional blocks in the template (found the "related news" block and the "comments" block)
5 view loads (include_once) the controllers of the found news_controller blocks. php and comment_controller.php 6.
comment controllers load the model, then return html
back to the view
class 7. view class gives html to the user....
(sample diagram)
I don't understand how to implement block search in template.
I think my approach is wrong, I think it's right to have all the data in one place before passing it to the blitz template engine (or template engine controller).
Please correct me and advise solutions and / or the "correct" scheme (procedure) of displaying the page to the user.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gro, 2013-11-30
@gro

For blitz, you need to collect all the data in controllers beforehand.
Therefore, I dumped on Twig, which I am glad and advise you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question