@@ 49-54 (lines=6) @@ | ||
46 | */ |
|
47 | public function locateResource(string $resourceName, ThemeInterface $theme): string |
|
48 | { |
|
49 | if (null !== $this->deviceDetection->getType()) { |
|
50 | $path = sprintf('%s/%s/%s', $theme->getPath(), $this->deviceDetection->getType(), $resourceName); |
|
51 | if ($this->filesystem->exists($path)) { |
|
52 | return $path; |
|
53 | } |
|
54 | } |
|
55 | ||
56 | $path = sprintf('%s/%s', $theme->getPath(), $resourceName); |
|
57 | if (!$this->filesystem->exists($path)) { |
@@ 91-96 (lines=6) @@ | ||
88 | } |
|
89 | ||
90 | foreach ($bundles as $bundle) { |
|
91 | if (null !== $this->deviceDetection->getType()) { |
|
92 | $path = sprintf('%s/%s/%s/%s', $theme->getPath(), $this->deviceDetection->getType(), $bundle->getName(), $resourceName); |
|
93 | if ($this->filesystem->exists($path)) { |
|
94 | return $path; |
|
95 | } |
|
96 | } |
|
97 | ||
98 | $path = sprintf('%s/%s/%s', $theme->getPath(), $bundle->getName(), $resourceName); |
|
99 | if ($this->filesystem->exists($path)) { |
|
@@ 111-116 (lines=6) @@ | ||
108 | { |
|
109 | $twigNamespace = substr($resourcePath, 1, strpos($resourcePath, '/') - 1); |
|
110 | $resourceName = substr($resourcePath, strpos($resourcePath, '/') + 1); |
|
111 | if (null !== $this->deviceDetection->getType()) { |
|
112 | $path = sprintf('%s/%s/%s/%s', $theme->getPath(), $this->deviceDetection->getType(), $this->getBundleOrPluginName($twigNamespace), $resourceName); |
|
113 | if ($this->filesystem->exists($path)) { |
|
114 | return $path; |
|
115 | } |
|
116 | } |
|
117 | ||
118 | $path = sprintf('%s/%s/views/%s', $theme->getPath(), $this->getBundleOrPluginName($twigNamespace), $resourceName); |
|
119 |