Example #1
0
 /**
  * Assemble route.
  * We just try to get all url variables, that is not isset, from the given object.
  * 
  * @param array[int]string $data
  * @param bool $reset
  * @param bool $encode
  * @param bool $partial
  * @return string Route path with user submitted parameters
  */
 public function assemble($data = array(), $reset = false, $encode = false, $partial = false)
 {
     if (isset($data['object']) && $data['object'] instanceof Centurion_Db_Table_Row_Abstract) {
         foreach ($this->_variables as $variable) {
             if (!isset($data[$variable])) {
                 if (isset($data['object']->{$variable})) {
                     $data[$variable] = $data['object']->{$variable};
                 }
             }
         }
         unset($data['object']);
     } else {
         throw new Zend_Controller_Router_Exception('No object given in a route object, of the object is not valid');
     }
     return parent::assemble($data, $reset, $encode, $partial);
 }
Example #2
0
 /**
  * Matches a user submitted path with parts defined by a map. Assigns and
  * returns an array of variables on a successful match.
  *
  * @param string $path Path used to match against this routing map
  * @return array|false An array of assigned values or a false on a mismatch
  */
 public function match($path, $partial = false)
 {
     return parent::match($path, $partial);
 }