lithium\net\http\Media::attached PHP Méthode

attached() public static méthode

Returns an attached mount point configuration.
public static attached ( $name = null )
    public static function attached($name = null)
    {
        if (!isset(static::$_scopes)) {
            static::_initScopes();
        }
        if ($name === false) {
            $name = '__defaultScope__';
        }
        return static::$_scopes->get($name);
    }

Usage Example

Exemple #1
0
 public function testListAttached()
 {
     Media::attach('media1', array('prefix' => 'media1', 'absolute' => true));
     Media::attach('media2', array('prefix' => 'media2', 'check' => true));
     Media::attach('media3', array('prefix' => 'media3'));
     $expected = array('media1' => array('prefix' => 'media1', 'absolute' => true, 'host' => 'localhost', 'scheme' => 'http://', 'base' => null, 'path' => null, 'timestamp' => false, 'filter' => null, 'suffix' => null, 'check' => false), 'media2' => array('prefix' => 'media2', 'absolute' => false, 'host' => 'localhost', 'scheme' => 'http://', 'base' => null, 'path' => null, 'timestamp' => false, 'filter' => null, 'suffix' => null, 'check' => true), 'media3' => array('prefix' => 'media3', 'absolute' => false, 'host' => 'localhost', 'scheme' => 'http://', 'base' => null, 'path' => null, 'timestamp' => false, 'filter' => null, 'suffix' => null, 'check' => false));
     $this->assertEqual($expected, Media::attached());
 }