Please may you recommend me a HTML template engine (any of scripting languages) which realize special concept described below.
All markers are active. Data should be not prepared before calling template, but template itself got data from Model. For example
{CurrentUser.name} will be replaced by name of current logged user, so I don't need to prepare data before calling template.
But also I can specify some "custom" data methods. For example if I have to make photogallery, and need only show a chunk of photos, I can use {PhotosListPart.thumb.url} and define special method for retrieving PhotosListPart, allowing to template automatically call it and get data asyncrounously.
Do you know any template engine / framework which supports this method of templating ?
Yes I understand what MVC only design pattern, but I cant imagine how you want implement url routing and call templates from it. For example you get request from user and you need show some data if you remove views all your business logic should be locate at models or at templates or elsewhere like helpers and so it turns out MVC but views to smeared on three places or more. But if you really want do this you can try to use Mako templates http://www.makotemplates.org/ with it you can write python code directly in templates as you want ))
Pull views are, views that pull data from the controller (which in turn calls the model to find the data).
If you strictly respect the MVC pattern[1], then you wouldn't be using any kind of pull views.
But AFAIK none[2] of the templating engines out there repspect MVC because they allow logic in the templates (if/foreach/function calls, etc.).
No templating engine will have pre-written code that assumes the presence of any data but almost all of them allow you to pass one single huge array of data filled with absolutely everything you need on a page.
If you need a templating engine that pre-populates data into variables, that's not a templating engine, that's a whole application, it contains logic which communicates with databases or models which takes it far away from the concept of templating engines.
[1] Respecting MVC when we talk about templating engines means using if only to check if a variable is set, for/foreach loops should not be present, ranging over a set/list of items is done by applying a template to the collection object, that and other concerns are illustrated here: http://bit.ly/Jc3f0Z
[2] Except: StringTemplate in Java, C# & Python; Moustache in a lot of languages including JS/Node.js/Java/PHP/Python/Ruby.
Using View classes to prepare data, and template files to output them always seamed like a kludge to me because the names become confusing (Views are classes + templates, templates are files).
That's why I name my preprocessing classes "Renderers" and my template files "Templates" so Renderers+Templates = Views. Which makes more sense to me as a name and as a philosophy.
I can use money_format/number_format/html_escape etc. within the renderers and then output already rendered data into the templates. Therefore I don't mix rendering/viewing actions with the controller. They all get done in the Renderer.