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

changing the layout in the handler function #4

Closed
PavelPolyakov opened this issue Feb 11, 2014 · 4 comments
Closed

changing the layout in the handler function #4

PavelPolyakov opened this issue Feb 11, 2014 · 4 comments

Comments

@PavelPolyakov
Copy link

Hi,

As I understand, according to the documentation, the layout is set during the project initialization.

How could I change the layout for the certain action?
Or I should simply

  m.Get("/", func(r render.Render) {
    r.Layout = "new-layout"
    r.HTML(200, "hello", "jeremy")
  })

??

Thanks

@dre1080
Copy link

dre1080 commented Feb 11, 2014

Like so:

m.Get("/", func(r render.Render) {
    r.HTML(200, "hello", "jeremy", render.HTMLOptions{
        Layout: "new-layout",
    })
})

@PavelPolyakov
Copy link
Author

Thanks

@codegangsta
Copy link
Member

Awesome. Closing out this isse

@lyonsun
Copy link

lyonsun commented Nov 20, 2014

@dre1080 , sorry for this stupid question, what is "hello", "jeremy" in that function? query string?

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

4 participants