Skip to content

How to use a placeholder without referencing a data object? #449

Answered by axunonb
mariusz96 asked this question in Q&A
Discussion options

You must be logged in to vote

The numbered or named placeholder selector must be omitted, because there is none (in your case, {0:t should read {:t:

var formatter = Smart.CreateDefaultSmartFormat();
var templates = new TemplateFormatter();
formatter.AddExtensions(templates);
templates.Register("SomeTemplate", "The template content");

var result = formatter.Format("{:t(SomeTemplate)}");
// result: "The template content"

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mariusz96
Comment options

Answer selected by mariusz96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #448 on November 19, 2024 19:34.