I am just wondering what is the best way to know which view to instantiate, in my application I have an individual view for each page and one master view which controls the generic functions and navigating between pages.
There are a couple of different ways that I could detect which page I am on and which view I should instantiate but I wanted some opinions on what others think is best.
So currently my options are:
- To detect via URL
- To detect via ID on containing element
If anyone has any better ideas that would be greatly appreciated.
Cheers.
UPDATE
I guess I could also add something like this on the HTML page:
<script>
var page_one_view = new PageOneView();
</script>
With the correct view being instantiated on each HTML page, but this seems very messy.