SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Helpers/FrontEndEntrance.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\Helpers;
  15.  
  16. /**
  17. * Defines that a specific controller is able to handle front-end entrances from the pages module
  18. **/
  19. interface FrontEndEntrance {
  20.  
  21. /**
  22.   * Return the list of [argument => label] options a tool page can call on this controller.
  23.   *
  24.   * See {@see UserController::_getEntranceArguments} for an example implementation
  25.   *
  26.   * @return array The keys are the valid arguments, and the values are their human-friendly labels
  27.   */
  28. public function _getEntranceArguments();
  29.  
  30.  
  31. /**
  32.   * Acts as the entrance-point of the controller, calling internal methods specific to each argument
  33.   *
  34.   * See {@see UserController::entrance} for an example implementation
  35.   *
  36.   * @param string $argument A key in the array returned by {@see FrontEndEntrance::_getEntranceArguments},
  37.   * each of which must be handled, usually by mapping onto one of the controller's own methods.
  38.   * @return void The underlying method should either output HTML or redirect
  39.   */
  40. public function entrance($argument);
  41.  
  42. }
  43.