Phrozn\Site\View\OutputPath\Script::get PHP Method

get() public method

Get calculated path
public get ( ) : string
return string
    public function get()
    {
        return rtrim($this->getView()->getOutputDir(), '/') . '/' . ltrim($this->getRelativeFile(), '/') . '.js';
    }

Usage Example

Example #1
0
 public function testScriptsPaths()
 {
     $view = new View\Less();
     $view->setInputFile('/var/www/phrozn-test/scripts/some-entry.js')->setOutputDir('/var/www/output');
     $path = new OutputPath\Script($view);
     $this->assertSame('/var/www/output/scripts/some-entry.js', $path->get());
     $view->setInputFile('/var/www/phrozn-test/scripts/sub/folder/some-entry.js')->setOutputDir('/var/www/output');
     $path->setView($view);
     $this->assertSame('/var/www/output/scripts/sub/folder/some-entry.js', $path->get());
     $view->setInputFile('/var/www/phrozn-test/sub/folder/some-entry.js')->setOutputDir('/var/www/output');
     $path->setView($view);
     $this->assertSame('/var/www/output/scripts/some-entry.js', $path->get());
 }
All Usage Examples Of Phrozn\Site\View\OutputPath\Script::get
Script