Skip to content

Commit

Permalink
apply realdir to web resource path && class rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisGalliano committed May 1, 2019
1 parent 832fe6a commit 922a01e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Pion\Templating\Assets\Resource\Path\ResourcePathInterface;

class WebResourcePath implements ResourcePathInterface
class WebAppResourcePath implements ResourcePathInterface
{

/**
Expand All @@ -15,7 +15,7 @@ class WebResourcePath implements ResourcePathInterface

public function __construct(string $path)
{
$this->path = $path;
$this->path = realpath($path);
}


Expand Down
4 changes: 2 additions & 2 deletions web-app/src/Homepage/HomepageView.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?
declare(strict_types=1);

use Src\Assets\Web\WebResourcePath;
use Src\Assets\Web\WebAppResourcePath;
use Src\HelloWorld\HelloWorldAction;

?>
Expand All @@ -11,7 +11,7 @@
Include img:
</div>
<div class="result">
<img src="<?= (new WebResourcePath(realpath(__DIR__ . '/../../web/assets/images/logo/logo.jpg')))->get() ?>" alt="logo">
<img src="<?= (new WebAppResourcePath(realpath(__DIR__ . '/../../web/assets/images/logo/logo.jpg')))->get() ?>" alt="logo">
</div>
</article>

Expand Down
4 changes: 2 additions & 2 deletions web-app/src/Layout/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Pion\Templating\Renderable\RenderableInterface;
use Src\Assets\Scss\ScssResourcePath;
use Src\Assets\Section\SectionIds;
use Src\Assets\Web\WebResourcePath;
use Src\Assets\Web\WebAppResourcePath;

final class Layout implements RenderableInterface
{
Expand All @@ -36,7 +36,7 @@ public function render(EngineInterface $engine) : string
{
$engine->assetsManager()
->add(
new JsResource(new WebResourcePath(__DIR__ . '../../web/assets/compiled/libs/jquery.min.js')),
new JsResource(new WebAppResourcePath(__DIR__ . '../../web/assets/compiled/libs/jquery.min.js')),
SectionIds::SECTION_FOOTER
)
->add(
Expand Down

0 comments on commit 922a01e

Please sign in to comment.