25 lines
579 B
PHP
25 lines
579 B
PHP
<?php
|
|
|
|
namespace App\Themes;
|
|
|
|
use App\Models\Property;
|
|
use Illuminate\Contracts\Support\Renderable;
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
/**
|
|
* Keeps the section's property active when the page eventually renders its Blade view and partials.
|
|
*/
|
|
class SectionView implements Renderable
|
|
{
|
|
public function __construct(
|
|
private Theme $theme,
|
|
private ?Property $property,
|
|
private View $view,
|
|
) {}
|
|
|
|
public function render(): string
|
|
{
|
|
return $this->theme->runForProperty($this->property, fn (): string => $this->view->render());
|
|
}
|
|
}
|