Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final class MyController(TView) : Controller!TView
- {
- private:
- view_defaultview defaultview;
- view_someotherview someotherview;
- public:
- this(TView view)
- {
- super(view);
- }
- @HttpMandatory Status mandatoryAction()
- {
- if (condition)
- {
- someotherview = view.getRaw!"someotherview";
- view = someotherview; // If you remove this, then it will already work, but "view" will always referre to defaultview
- }
- return Status.success;
- }
- @HttpDefault Status defaultAction()
- {
- // Don't use "view" directly. Use whichever view you need instead, unless it's generic functionality.
- if (someotherview)
- {
- ...
- }
- else
- {
- // use defaultview
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement