FluidTYPO3\Vhs\Asset::createFromFile PHP Метод

createFromFile() публичный статический Метод

public static createFromFile ( string $filePathAndFilename ) : Asset
$filePathAndFilename string
Результат Asset
    public static function createFromFile($filePathAndFilename)
    {
        $asset = self::getInstance();
        $asset->setExternal(false);
        $asset->setPath($filePathAndFilename);
        return $asset->finalize();
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function buildMethodsReturnExpectedValues()
 {
     $file = $this->getAbsoluteAssetFixturePath();
     $asset = Asset::createFromFile($file);
     $constraint = new \PHPUnit_Framework_Constraint_IsType('string');
     $this->assertThat($asset->render(), $constraint);
     $this->assertNotEmpty($asset->render());
     $this->assertThat($asset->build(), $constraint);
     $this->assertNotEmpty($asset->build());
     $this->assertSame($asset, $asset->finalize());
 }