title: Passing Argument to main.scala.html
body: <p>Problem <strong>(which works)</strong>:</p>
  
  <p>I am using Play 2.1.x version in my application. My application has a static header/toolbar which has SignIn/SignOut links. Instead of repeating status header html code in all the templates, I created that in main.scala.html template. Now to change SignIn/SignOut status, I need to pass an argument to main.scala.html.
    If I am right this is the parent template for all the templates we use in play, so if we add any argument to main template, it has to be provided by the child templates like for e.g index, login etc (you name it)</p>
  
  <p>So far I am able to do this by creating an implicit def in a trait and let controller implement the trait like this (mixing composition...)</p>
  
  <pre><code>class ApplicationController extends Controller with ImplicitSession{
  
  }
  
  trait ImplicitSession {
  implicit def status(implicit session: play.api.mvc.Session): Boolean = {
  session.get("session") match {
    case None =&gt; false
    case _ =&gt; true
   }
  }
  </code></pre>
  
  <p>and let my all the other controller extends ApplicationController instead of only play Controller</p>
  
  <pre><code>object LoginController extends ApplicationController{...}
  </code></pre>
  
  <p>Now My templates arguments look like this...</p>
  
  <p>Main Template</p>
  
  <pre><code>@(title: String)(content: Html)(implicit status : Boolean)
  </code></pre>
  
  <p>other templates like login...</p>
  
  <pre><code>@(message: String)(implicit status : Boolean)
  </code></pre>
  
  <p><strong>This works Fine</strong> but I am not happy with the solution because it force me to pass this extra implicit parameter to all my templates</p>
  
  <p><strong>I really want to avoid passing this implicit parameter to my all child templates</strong> </p>
  
  <p>because I feel this is a redundant code and indeed not a good programming practice. So Looks like I didn't get this concept clear in my mind</p>
  
  <p>Also compiler force me to put Action{ <strong>implicit request =></strong> to all the controller I am creating otherwise it just throw an compilation error</p>
  
  <p>I checked the sample code provided in the play bundle, they are good but my doubt of the flow is not clear..</p>
  
  <p>Thanks in Advance</p>