示例#1
0
 /**
  * Parse clean URL
  * Return array((string) $target, (array) $params)
  *
  * @param string $url  Main part of a clean URL
  * @param string $last First part before the "url" OPTIONAL
  * @param string $rest Part before the "url" and "last" OPTIONAL
  * @param string $ext  Extension OPTIONAL
  *
  * @return array
  */
 protected function parseURLProduct($url, $last = '', $rest = '', $ext = '')
 {
     $result = null;
     if ($ext) {
         $result = parent::parseURLProduct($url, $last, $rest, $ext);
         if (empty($result) && 0 === strpos($url, static::REVIEWS_PREFIX)) {
             $url = preg_replace('/^' . preg_quote(static::REVIEWS_PREFIX) . '/', '', $url);
             $result = parent::parseURLProduct($url, $last, $rest, $ext);
             if ($result) {
                 $result[0] = 'product_reviews';
             }
         }
     }
     return $result;
 }