public function locate($name, $dir = null, $first = true)
    {
        // update the paths if the theme changed since the last lookup
        $theme = $this->activeTheme->getName();

        if ($this->lastTheme !== $theme) {
            $this->setCurrentTheme($theme, $this->activeTheme->getDeviceType());
        }

        if ('@' === $name[0]) {
            return $this->locateBundleResource($name, $this->path, $first);
        }

        if (0 === strpos($name, 'views/')) {
            if ($res = $this->locateAppResource($name, $this->path, $first)) {
                return $res;
            }
        }

        return parent::locate($name, $dir, $first);
    }
public function locate($name, $dir = null, $first = true)
    {
        // update the paths if the theme changed since the last lookup
        $theme = $this->activeTheme->getName();

        if ($this->lastTheme !== $theme) {
            $this->setCurrentTheme($theme, $this->activeTheme->getDeviceType());
        }

        if ('@' === $name[0]) {
            return $this->locateBundleResource($name, $this->path, $first);
        }

        if (0 === strpos($name, 'views/')) {
            if ($res = $this->locateAppResource($name, $this->path, $first)) {
                return $res;
            }
        }

        return parent::locate($name, $dir, $first);
    }
public function locate ( $ name , $ dir = null , $ first = true ) { // update the paths if the theme changed since the last lookup $ theme = $ this -> activeTheme -> getName ( ) ; if ( $ this -> lastTheme !== $ theme ) { $ this -> setCurrentTheme ( $ theme , $ this -> activeTheme -> getDeviceType ( ) ) ; } if ( '@' === $ name [ 0 ] ) { return $ this -> locateBundleResource ( $ name , $ this -> path , $ first ) ; } if ( 0 === strpos ( $ name , 'views/' ) ) { if ( $ res = $ this -> locateAppResource ( $ name , $ this -> path , $ first ) ) { return $ res ; } } return parent :: locate ( $ name , $ dir , $ first ) ; }
Returns the file path for a given resource for the first directory it
has a match.

The resource name must follow the following pattern:

"@BundleName/path/to/a/file.something"

where BundleName is the name of the bundle
and the remaining part is the relative path in the bundle.

@param string $name  A resource name to locate
@param string $dir   A directory where to look for the resource first
@param bool   $first Whether to return the first path or paths for all matching bundles

@return string|array The absolute path of the resource or an array if $first is false

@throws \InvalidArgumentException if the file cannot be found or the name is not valid
@throws \RuntimeException         if the name contains invalid/unsafe characters
Returns the file path for a given resource for the first directory it has a match .