1
votes

I have a bit of problem with new router. I would like to have header which is a separate controller-view. And to be honest I'm not sure how to achieve it.

I tried to define footer and header in index controller/template and in IndexRoute do redirect to "gallerys" route but then the index template is ommited.

With previous router I created index template with: {{outlet "hedaer"}} {{outlet "body" }} {{outlet "footer"}}

But now, I'm not sure how to connect it all.

1
I think I found a solution: use ApplicationView and ApplicationController to handle all header&footer "stuff". But I'm still not sure if it's the right way to do this.Kamil Biela

1 Answers

3
votes

I would define the application template like this:

{{render header}}
{{outlet}}
{{render footer}}

The render helper will lookup both HeaderView class, and the instance of the headerController and connect them. The same with footer.