MiniAsset\Output\AssetWriter::buildFileName PHP Метод

buildFileName() публичный Метод

Get the final filename for a build. Resolves theme prefixes and timestamps.
public buildFileName ( AssetTarget $target, $timestamp = true ) : string
$target MiniAsset\AssetTarget The build target name.
Результат string The build filename to cache on disk.
    public function buildFileName(AssetTarget $target, $timestamp = true)
    {
        $file = $target->name();
        if ($target->isThemed() && $this->theme) {
            $file = $this->theme . '-' . $file;
        }
        if ($timestamp) {
            $time = $this->getTimestamp($target);
            $file = $this->_timestampFile($file, $time);
        }
        return $file;
    }

Usage Example

 public function testBuildFileNameTimestampNoValue()
 {
     $writer = new AssetWriter(['js' => true, 'css' => false], TMP);
     $time = time();
     $result = $writer->buildFileName($this->target);
     $this->assertEquals('test.v' . $time . '.js', $result);
 }