Acdc RocknRoll
Acdc RocknRoll

Reputation: 687

play 1.2.5 include controller render result

I want to include the rendering result of a controller in another template.With the "@"-Digit it is possible to get the URL of a controller-method.Is it possible in play 1.2.5 to geht the whole html-result of a controller-method?

Upvotes: 0

Views: 133

Answers (1)

Seb Cesbron
Seb Cesbron

Reputation: 3833

This is not so simple because the controller rendering process directly render the template into the response. You have several ways to achieve that

  • Use a tag to put the common part between your templates and call this tag in each template with the right parameters.
  • Use the TemplateLoader api to render a custom template and get the result
  • Call the "render" method inside a try/catch, catch the RenderTemplate exception and get the content (I never tried this method)

Upvotes: 1

Related Questions