What is the difference between render template and render template post? #129
-
This is a question about the difference between: Render a template$result = tangible_template( $content ); Function defined in Render a template post$result = tangible_template_system()->render_template_post([
'content' => $content
]); Function defined in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
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.