Gc\Registry::get PHP Méthode

get() public static méthode

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
Résultat 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

Exemple #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