| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function getOnePageContent() |
||
| 14 | { |
||
| 15 | $templateNames = SSViewer::get_templates_by_class( |
||
| 16 | $this->owner->Classname, |
||
| 17 | '_onepage', |
||
| 18 | SiteTree::class |
||
| 19 | ) |
||
| 20 | ?: ['Page_onepage', 'type' => 'Layout']; |
||
| 21 | |||
| 22 | foreach ($templateNames as $templateName) { |
||
| 23 | if (!is_array($templateName)) { |
||
| 24 | $templateNames[] = [$templateName, 'type' => 'Layout']; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | $controller = ModelAsController::controller_for($this->owner); |
||
| 29 | return $controller->renderWith($templateNames); |
||
| 30 | } |
||
| 32 |