Skip to content

What is the difference between render template and render template post? #129

Answered by eliot-akira
eliot-akira asked this question in Q&A
Discussion options

You must be logged in to vote

The first method is from the Language/HTML module, and converts a template string to HTML. The second method is in the Admin module, and deals with template posts.

A template post is an object with main content and additional fields like script, style, assets.

Every time it's rendered, the template system creates a new "context" with a local scope of variables, enqueued scripts and styles, a Catch boundary for the Exit tag.

So a template post is one level of abstraction higher than a template string, with additional features.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eliot-akira
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant