bliss
bliss copied to clipboard
Documentation example for global vars
It might be worth it to outline specifically that you can have an example context... the below allowing one to extend viewbag in the view, then when rendering down to the layout, it can be utilized...
context: {
viewbag:{}
}
which should allow you to attach parameters to the viewbag, such as viewbag.title, that will be carried out to a layout. Which will be somewhat similar to what you may be used to...
Another suggestion of convention would be to pass (regions/model) as a single argument... This way certain conventions can be extended while keeping the same signature... such as the (error,data,callback) signature in a lot of node itself... if a layout gets (regions) and the target view or partial gets a (model), while this would take a bit more effort to utilize, it's just a thought.
layout.cs.html
@(regions)
...
@regions.side()
...
@regions.body()
...
index.cs.html
@(model)
@function side() { ...}
@function body() {...}
@render('layout',{side:side,body:body})
Thank you for this. I will think about this.