Gc\Registry::get PHP 메소드

get() 공개 정적인 메소드

This method can be called from an object of type Zendregistry, or it can be called statically. In the latter case, it uses the default static instance stored in the class.
public static get ( string $index ) : mixed
$index string - get the value associated with $index
리턴 mixed
    public static function get($index)
    {
        $instance = self::getInstance();
        if (!$instance->offsetExists($index)) {
            throw new RuntimeException("No entry is registered for key '{$index}'");
        }
        return $instance->offsetGet($index);
    }

Usage Example

예제 #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testInvokeUnsecure()
 {
     $coreConfig = Registry::get('Application')->getServiceManager()->get('CoreConfig');
     $basePath = $coreConfig->setValue('force_backend_ssl', 0);
     $basePath = $coreConfig->setValue('unsecure_cdn_base_path', 'http://got-cms.com');
     $this->assertEquals('http://got-cms.com/test', $this->object->__invoke('test'));
 }
All Usage Examples Of Gc\Registry::get