示例#1
0
文件: Router.php 项目: solve/router
 public function getRoute($routeName)
 {
     $route = null;
     if ($this->_routes->has($routeName)) {
         $info = $this->_routes->get($routeName);
         $route = new Route($routeName, $info['pattern'], $info);
     }
     return $route;
 }
示例#2
0
 public function testBasic()
 {
     $storage = new ArrayStorage();
     $storage->offsetSet('key', 'value');
     $this->assertEquals('value', $storage->offsetGet('key'), 'offsetGet after offsetSet');
     $this->assertEquals('value', $storage->get('key'), 'get after offsetSet');
     $this->assertEquals('value', $storage['key'], '[]get after offsetSet');
     $this->assertEquals('value', $storage->key, '__get after offsetSet');
     $storage->key2 = 'value2';
     $this->assertEquals('value2', $storage->key2, '__get after __set');
     $this->assertEquals('value2', $storage->get('key2'), 'get after __set');
     $this->assertEquals('value', $storage->getFirst(), 'first item getter');
     $this->assertEquals('value2', $storage->getLast(), 'last item getter');
 }
示例#3
0
文件: View.php 项目: solve/solve
 public function getCombinedVars($format = null)
 {
     if (!$format) {
         $format = $this->_responseFormat;
     }
     $combinedVars = new ArrayStorage($this->_vars);
     if ($this->_formatVars->has($format)) {
         $combinedVars->extendDeepValue($this->_formatVars->get($format));
     }
     if ($format == View::FORMAT_HTML) {
         $combinedVars['_baseUri'] = DC::getRouter()->getBaseUri();
     }
     return $combinedVars;
 }
示例#4
0
 public function get($key = null)
 {
     return $this->_data->get($key);
 }
示例#5
0
 public function get($name)
 {
     return $this->_storage->get($name);
 }