Completed
Push — master ( 2a8024...373a8a )
by Tom
19:54 queued 13s
created

BladeElement::getPath()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace Curlyspoon\Core\Elements;
4
5
use Illuminate\View\Factory;
6
use Illuminate\Container\Container;
7
8
abstract class BladeElement extends Element
9
{
10
    public function render(): string
11
    {
12
        return $this->getEngine()->make(implode('.', array_filter([
13
            $this->getPath(),
14
            $this->name
15
        ])), $this->getOptions())->render();
16
    }
17
18
    abstract protected function getPath(): string;
19
20
    protected function getEngine(): Factory
21
    {
22
        return Container::getInstance()->make('view');
23
    }
24
}
25