web/lib/Zend/Controller/Router/Route/Static.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Controller
    16  * @package    Zend_Controller
    17  * @subpackage Router
    17  * @subpackage Router
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @version    $Id: Static.php 23210 2010-10-21 16:10:55Z matthew $
    19  * @version    $Id: Static.php 24593 2012-01-05 20:35:02Z matthew $
    20  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    21  */
    21  */
    22 
    22 
    23 /** Zend_Controller_Router_Route_Abstract */
    23 /** Zend_Controller_Router_Route_Abstract */
    24 require_once 'Zend/Controller/Router/Route/Abstract.php';
    24 require_once 'Zend/Controller/Router/Route/Abstract.php';
    28  *
    28  *
    29  * It's a lot faster compared to the standard Route implementation.
    29  * It's a lot faster compared to the standard Route implementation.
    30  *
    30  *
    31  * @package    Zend_Controller
    31  * @package    Zend_Controller
    32  * @subpackage Router
    32  * @subpackage Router
    33  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    33  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    34  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    34  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    35  */
    35  */
    36 class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_Abstract
    36 class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_Abstract
    37 {
    37 {
    38 
    38 
    60      * @param string $route Map used to match with later submitted URL path
    60      * @param string $route Map used to match with later submitted URL path
    61      * @param array $defaults Defaults for map variables with keys as variable names
    61      * @param array $defaults Defaults for map variables with keys as variable names
    62      */
    62      */
    63     public function __construct($route, $defaults = array())
    63     public function __construct($route, $defaults = array())
    64     {
    64     {
    65         $this->_route = trim($route, '/');
    65         $this->_route = trim($route, self::URI_DELIMITER);
    66         $this->_defaults = (array) $defaults;
    66         $this->_defaults = (array) $defaults;
    67     }
    67     }
    68 
    68 
    69     /**
    69     /**
    70      * Matches a user submitted path with a previously defined route.
    70      * Matches a user submitted path with a previously defined route.
    81             ) {
    81             ) {
    82                 $this->setMatchedPath($this->_route);
    82                 $this->setMatchedPath($this->_route);
    83                 return $this->_defaults;
    83                 return $this->_defaults;
    84             }
    84             }
    85         } else {
    85         } else {
    86             if (trim($path, '/') == $this->_route) {
    86             if (trim($path, self::URI_DELIMITER) == $this->_route) {
    87                 return $this->_defaults;
    87                 return $this->_defaults;
    88             }
    88             }
    89         }
    89         }
    90 
    90 
    91         return false;
    91         return false;