Beispiel #1
0
 /**
  * Returns true if the URL matches this route, false otherwise.
  *
  * @param  string  $url     The URL
  * @param  array   $context The context
  *
  * @return array   An array of parameters
  */
 public function matchesUrl($url, $context = array())
 {
     $url = aRouteTools::removePageFromUrl($this, $url);
     // No engine page found
     if ($url === false) {
         return false;
     }
     return parent::matchesUrl($url, $context);
 }
Beispiel #2
0
 public function matchesUrl($url, $context = array())
 {
     if (false === ($param = parent::matchesUrl($url, $context))) {
         return false;
     }
     $lecture = Doctrine_Query::create()->from('Lecture l, Course c')->select('l.*')->where('l.course_id = c.id')->andWhere('l.url = ?', $param['lecture_url'])->andWhere('c.url = ?', $param['course_url'])->fetchOne();
     if ($lecture === false) {
         return false;
     }
     return array_merge($param, array('id' => $lecture->id));
 }
 public function matchesUrl($url, $context = array())
 {
     if (false === ($parameters = parent::matchesUrl($url, $context))) {
         return false;
     }
     if (!$parameters['slug']) {
         return false;
     }
     if ($res = parent::matchesUrl($url, $context)) {
         $page = Doctrine_Core::getTable('Cms')->retrieveBySlug($parameters);
     }
     if (!$page) {
         return false;
     } else {
         $this->object = $page;
     }
     return $res;
 }
Beispiel #4
0
 /**
  * Returns true if the URL matches this route, false otherwise.
  *
  * @param  string  $url     The URL
  * @param  array   $context The context
  *
  * @return array   An array of parameters
  */
 public function matchesUrl($url, $context = array())
 {
     $url = aRouteTools::removePageFromUrl($this, $url);
     return parent::matchesUrl($url, $context);
 }