Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | protected function views() { |
||
17 | $views = []; |
||
18 | |||
19 | $views[] = config('storyblok.view_path') . 'blocks.uuid.' . $this->_uid; |
||
20 | $segments = explode('/', rtrim(app()->make('Page')->slug(), '/')); |
||
21 | // creates an array of dot paths for each path segment |
||
22 | // site.com/this/that/them becomes: |
||
23 | // this.that.them |
||
24 | // this.that |
||
25 | // this |
||
26 | $views[] = config('storyblok.view_path') . 'blocks.' . implode('.', $segments) . '.=' . $this->component; |
||
27 | $views[] = config('storyblok.view_path') . 'blocks.' . implode('.', $segments) . '.' . $this->component; |
||
28 | while (count($segments) > 1) { |
||
29 | array_pop($segments); |
||
30 | $views[] = config('storyblok.view_path') . 'blocks.' . implode('.', $segments) . '.' . $this->component; |
||
31 | } |
||
32 | |||
33 | $views[] = config('storyblok.view_path') . 'blocks.' . $this->component; |
||
34 | $views[] = config('storyblok.view_path') . 'blocks.default'; |
||
35 | |||
36 | return $views; |
||
37 | } |
||
53 | } |