public function parseResource($resource)
    {
        $pluginId = $file = null;
        if (isset($resource[0]) && $resource[0] == '@') {
            list($pluginId, $file) = explode('/', $resource, 2);
            $pluginId = substr($pluginId, 1);
        }

        // @deprecated
        if (strpos($resource, ':') !== false) {
            wei()->logger->warning('deprecated view', $resource);
            list($pluginId, $file) = explode(':', $resource, 2);
        }

        if ($pluginId) {
            $plugin = $this->getOneById($pluginId);
            $path = $plugin->getBasePath() . '/resources';

            return ['path' => $path, 'file' => $file];
        } else {
            return ['path' => null, 'file' => $resource];
        }
    }
public function parseResource($resource)
    {
        $pluginId = $file = null;
        if (isset($resource[0]) && $resource[0] == '@') {
            list($pluginId, $file) = explode('/', $resource, 2);
            $pluginId = substr($pluginId, 1);
        }

        // @deprecated
        if (strpos($resource, ':') !== false) {
            wei()->logger->warning('deprecated view', $resource);
            list($pluginId, $file) = explode(':', $resource, 2);
        }

        if ($pluginId) {
            $plugin = $this->getOneById($pluginId);
            $path = $plugin->getBasePath() . '/resources';

            return ['path' => $path, 'file' => $file];
        } else {
            return ['path' => null, 'file' => $resource];
        }
    }
public function parseResource ( $ resource ) { $ pluginId = $ file = null ; if ( isset ( $ resource [ 0 ] ) && $ resource [ 0 ] == '@' ) { list ( $ pluginId , $ file ) = explode ( '/' , $ resource , 2 ) ; $ pluginId = substr ( $ pluginId , 1 ) ; } // @deprecated if ( strpos ( $ resource , ':' ) !== false ) { wei ( ) -> logger -> warning ( 'deprecated view' , $ resource ) ; list ( $ pluginId , $ file ) = explode ( ':' , $ resource , 2 ) ; } if ( $ pluginId ) { $ plugin = $ this -> getOneById ( $ pluginId ) ; $ path = $ plugin -> getBasePath ( ) . '/resources' ; return [ 'path' => $ path , 'file' => $ file ] ; } else { return [ 'path' => null , 'file' => $ resource ] ; } }
Parse a resource and return the components contains path and file

@param string $resource
@return array|false Returns false when resource is not starts with @
Parse a resource and return the components contains path and file