| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | protected function views() { |
||
| 9 | $views[] = 'storyblok.blocks.uuid.' . $this->_uid; |
||
|
|
|||
| 10 | $segments = explode('/', rtrim(app()->make('Page')->slug(), '/')); |
||
| 11 | // creates an array of dot paths for each path segment |
||
| 12 | // site.com/this/that/them becomes: |
||
| 13 | // this.that.them |
||
| 14 | // this.that |
||
| 15 | // this |
||
| 16 | $views[] = 'storyblok.blocks.' . implode('.', $segments) . '.=' . $this->component; |
||
| 17 | $views[] = 'storyblok.blocks.' . implode('.', $segments) . '.' . $this->component; |
||
| 18 | while (count($segments) > 1) { |
||
| 19 | array_pop($segments); |
||
| 20 | $views[] = 'storyblok.blocks.' . implode('.', $segments) . '.' . $this->component; |
||
| 21 | } |
||
| 22 | |||
| 23 | $views[] = 'storyblok.blocks.' . $this->component; |
||
| 24 | $views[] = 'storyblok.blocks.default'; |
||
| 25 | |||
| 26 | return $views; |
||
| 27 | } |
||
| 57 | } |