SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Controllers/ResultController.php

  1. <?php
  2. /*
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  */
  13.  
  14. namespace Sprout\Controllers;
  15.  
  16. use Sprout\Helpers\View;
  17.  
  18.  
  19. /**
  20.  * Used to handle generic success and error messages after processing a POST submission, when
  21.  * there isn't a particularly good URL to redirect to.
  22.  */
  23. class ResultController extends Controller
  24. {
  25. /**
  26.   * Generic page for displaying one or more error messages set via {@see Notification::error}
  27.   *
  28.   * @return void Outputs HTML directly
  29.   */
  30. public function error()
  31. {
  32. $skin = new View('skin/inner');
  33. $skin->page_title = 'Error';
  34. $skin->main_content = '';
  35. echo $skin->render();
  36. }
  37.  
  38.  
  39. /**
  40.   * Generic page for displaying one or more success messages set via {@see Notification::confirm}
  41.   *
  42.   * @return void Outputs HTML directly
  43.   */
  44. public function success()
  45. {
  46. $skin = new View('skin/inner');
  47. $skin->page_title = 'Success';
  48. $skin->main_content = '';
  49. echo $skin->render();
  50. }
  51. }
  52.