Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. final class MyController(TView) : Controller!TView
  2. {
  3. this(TView view)
  4. {
  5. super(view);
  6. }
  7.  
  8. @HttpDefault Status defaultAction()
  9. {
  10. //default view is 'default'
  11.  
  12. if(condition == true) {
  13. view = view.view("someotherview");
  14.  
  15. // if you needed to use it:
  16. auto someotherview = cast(view_someotherview)view;
  17.  
  18. // If the name of the view can be interfered at compile-time you can replace above with:
  19. auto someotherview = view.viewRaw!"someotherview";
  20. view = someotherview;
  21.  
  22. // ...
  23. }
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement