Source for file Router.class.php

Documentation is available at Router.class.php

  1. <?php
  2. /**
  3.  * Gumbo Library Framework
  4.  *
  5.  * LICENSE
  6.  * This library is being released under the terms of the New BSD License.  A
  7.  * copy of the license is packaged with the software (LICENSE.txt).  If no
  8.  * copy is found, a copy of the license template can be found at:
  9.  * http://www.opensource.org/licenses/bsd-license.php
  10.  * 
  11.  * @category Gumbo
  12.  * @package Router
  13.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  14.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  15.  * @author Michael Luster <mluster79@yahoo.com>
  16.  * @link http://sourceforge.net/projects/phpgumbo
  17.  * @version 0.0.1
  18.  */
  19.  
  20. /**
  21.  * Router Interface
  22.  * 
  23.  * A Router is simply a class that changes the current location of the browser
  24.  * to the specified URL.  In order to jump, the object must be active.  The Delay
  25.  * is meant to hold from the jump for a given amount of time (in seconds).  The
  26.  * Flush option will flush the buffer before routing.
  27.  *
  28.  * @category Gumbo
  29.  * @package Router
  30.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  31.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  32.  * @author Michael Luster <mluster79@yahoo.com>
  33.  * @link http://sourceforge.net/projects/phpgumbo
  34.  * @desc Router Interface
  35.  * @version 0.0.1
  36.  */
  37.  
  38.     
  39.     /** ACTION METHODS **/
  40.     /**
  41.      * Jumps to the supplied URL
  42.      * @precondition isActive ()
  43.      */
  44.     public function go ();
  45.     
  46.     /**
  47.      * Activates the Router
  48.      * @postcondition isActive()
  49.      */
  50.     public function activate ();
  51.     
  52.     /**
  53.      * Deactivates the Router
  54.      * @postcondition !isActive()
  55.      */
  56.     public function deactivate ();
  57.     
  58.     
  59.     
  60.     /** MUTATOR METHODS **/
  61.     /**
  62.      * Sets the URL to jump to
  63.      * @precondition Valid_Web::isUrl ()
  64.      * @param string $url 
  65.      */
  66.     public function setUrl ($url);
  67.     
  68.     /**
  69.      * Sets the delay time, in seconds, before routing
  70.      * @precondition 0 <= delay <= 30
  71.      * @param int $delay 
  72.      */
  73.     public function setDelay ($delay);
  74.     
  75.     /**
  76.      * Sets the program to flush the buffer before routing
  77.      * @param bool $val 
  78.      */
  79.     public function setFlush ($val);
  80.     
  81.     
  82.     
  83.     /** ACCESSOR METHODS **/
  84.     /**
  85.      * Returns the Url
  86.      * @return string 
  87.      */
  88.     public function getUrl ();
  89.     
  90.     /**
  91.      * Returns the delay time, in seconds
  92.      * @return int 
  93.      */
  94.     public function getDelay ();
  95.     
  96.     /**
  97.      * Returns if the buffer should be flushed
  98.      * @return bool 
  99.      */
  100.     public function getFlush ();
  101.     
  102.     /**
  103.      * Returns if the Router is active
  104.      * @return bool 
  105.      */
  106.     public function isActive ();
  107.     
  108. }
  109.  
  110. ?>