Back to WebAssetRegistry class

Method addRegistryFile

public self
addRegistryFile
(string $path)
Register new file with Asset(s) info
Parameters
  • string $path Relative path
Returns
  • self
Since
  • 4.0.0

Method addRegistryFile - Source code

/**
 * Register new file with Asset(s) info
 *
 * @param   string  $path  Relative path
 *
 * @return  self
 *
 * @since  4.0.0
 */
public function addRegistryFile(string $path) : self
{
    $path = Path::clean($path);
    if (isset($this->dataFilesNew[$path]) || isset($this->dataFilesParsed[$path])) {
        return $this;
    }
    if (is_file(JPATH_ROOT . '/' . $path)) {
        $this->dataFilesNew[$path] = $path;
    }
    return $this;
}