updateResource() public method

Updates the string resource with the FileResource
public updateResource ( FileResource $resource, integer $pos ) : Vars
$resource M1\Vars\Resource\FileResource The FileResource to add
$pos integer The position of the string resource
return Vars
Beispiel #1
0
 /**
  * Creates the FileResource|ResourceProvider from the resource
  *
  * @param array  $resources The array of resources
  * @param string $type      The type of the resource
  */
 private function createResources(array $resources, $type)
 {
     foreach ($resources as $resource) {
         if ($type === "string") {
             $this->vars->pathsLoadedCheck($resource);
             if ($this->vars->cache->checkCache()) {
                 return;
             }
             if ($this->vars->resourceImported($resource)) {
                 continue;
             }
             $pos = $this->vars->addResource($resource);
             $resource = new FileResource($this, $resource);
             $this->vars->updateResource($resource, $pos);
         } else {
             $resource = new ResourceProvider($this->vars, $resource);
         }
         $this->addContent($resource->getContent());
     }
 }