Answers.Body: <p>You can just pass in the EntryModel straight to the view.</p>
  
  <pre><code>$html = craft()-&gt;templates-&gt;render('path/to/template', [ 'entry' =&gt; $entryModel ]); 
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T18:09:37.753Z
Answers.Text: Okay, exactly what I was looking form. Can you tell me where you locate this info in the docs? I could not find it.
Answers.UserDisplayName: David A McInnis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T18:11:06.117Z
Answers.Text: I didn't. I was looking for the same thing, and after a bit of fumbling about, looking at the rendering process etc., I simply tried passing it, and it worked. All the hard lifting is done by the models, I think. The render layer just show whatever is passed to it, so it's as simple as that.
Answers.UserDisplayName: Fred Carlsen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T19:41:03.617Z
Answers.Text: This answer is spot on... It's not documented, but this is exactly the right way to do it. Twig templates will handle Model objects just as easily as the PHP does, basically treating it as an associative array.
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T18:04:59.137Z
Answers.LastActivityDate: 2014-09-23T18:04:59.137Z
Answers.UserDisplayName: Fred Carlsen
Body: <p>In looking over the docs on <a href="http://buildwithcraft.com/docs/plugins/templates" rel="nofollow">template rendering</a> I am not seeing a way to pass in an Entry model. It seems more efficient to pass in an existing model rather than have the template do another lookup. Something like:</p>
  
  <pre><code>$html = craft()-&gt;templates-&gt;render('path/to/template', $myEntry); 
  </code></pre>
  
  <p>Here is my use case. I want to use the craft template rendering engine to compose email messages. </p>
  
Tags: <templating><emails>
Title: Passing Entry to craft()->templates->render()
ThreadText: # Passing Entry to craft()->templates->render()
  
  (Asked by: username_0 on 2014-09-23)
  
  In looking over the docs on [template rendering](http://buildwithcraft.com/docs/plugins/templates) I am not seeing a way to pass in an Entry model. It seems more efficient to pass in an existing model rather than have the template do another lookup. Something like:
  
  ```
  $html = craft()->templates->render('path/to/template', $myEntry); 
  
  ```
  
  Here is my use case. I want to use the craft template rendering engine to compose email messages.
  
  **Tags:** templating, emails
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-09-23. Score: 10 | Accepted answer
  
  You can just pass in the EntryModel straight to the view.
  
  ```
  $html = craft()->templates->render('path/to/template', [ 'entry' => $entryModel ]); 
  
  ```
  
  > **Comments:**
  > **username_0**: Okay, exactly what I was looking form. Can you tell me where you locate this info in the docs? I could not find it.  
  > **username_1**: I didn't. I was looking for the same thing, and after a bit of fumbling about, looking at the rendering process etc., I simply tried passing it, and it worked. All the hard lifting is done by the models, I think. The render layer just show whatever is passed to it, so it's as simple as that.  
  > **username_2**: This answer is spot on... It's not documented, but this is exactly the right way to do it. Twig templates will handle Model objects just as easily as the PHP does, basically treating it as an associative array.  
  
  ---
  
  