Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chauhan17nitin opened this issue Jan 21, 2024 · 0 comments
Open

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

chauhan17nitin opened this issue Jan 21, 2024 · 0 comments

Comments

@chauhan17nitin
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant