Skip to content

What tags deos pongo uses of declared structs struct? #345

@chauhan17nitin

Description

@chauhan17nitin

Suppose i have a struct like below

type Person struct {
Name string `json:"name"`
}

Now when wrapping my response in pongo context like below

dataContext := pongo2.Context{
    "person": person,
}

ctx.HTML(200, "user.html", dataContext)

in the HTML

{{person.name}} will not work, only {{person.Name}} works which means pongo using default fields names of struct.

Is there any way i can specify my field name manually for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions