1
0
cms11/app/Services/BundleRenderers/Renderers/TermRenderer.php

42 lines
992 B
PHP
Raw Normal View History

2024-04-26 13:47:36 +02:00
<?php
namespace App\Services\BundleRenderers\Renderers;
use App\Classes\Bundle;
class TermRenderer extends BaseRenderer
{
/**
* Renders a complete HTML view of the bundle
*/
public function render()
{
$this->prepareRender();
$relations = [];
foreach ($this->bundle->metadata('relations')->all() as $category => $bundles) {
foreach ($bundles as $path) {
$relations[$category][] = new Bundle($path, $this->bundle->getDisk());
}
}
data_set($this->viewData, 'relations', $relations);
return view('term', $this->viewData);
}
/**
* Return a boolean value indicating if this creator in particular can
* create bundles for specified section
*/
public static function handles(Bundle $bundle): bool
{
return $bundle->getSection() && $bundle->getSection()->getPath() === '/termes/';
}
protected function handlePagination()
{
}
}