ufm
1<?php declare(strict_types=1);2
3namespace Upside\Ufm\Config;4
5use Upside\Ufm\Config\Interfaces\AppConfigInterface;6use Upside\Ufm\Config\Interfaces\PathConfigInterface;7use Upside\Ufm\Config\Interfaces\ViewConfigInterface;8use Upside\View\Options;9use Upside\View\Provider;10
11readonly class ViewConfig implements ViewConfigInterface12{
13protected AppConfigInterface $app_config;14protected PathConfigInterface $path_config;15
16public function __construct(AppConfigInterface $app_config, PathConfigInterface $path_config)17{18$this->app_config = $app_config;19$this->path_config = $path_config;20}21
22public function compiler_dir(): string23{24return $this->path_config->cache_dir() . '/templates';25}26
27public function options(): Options28{29return new Options(30force_compile: $this->app_config->is_debug(),31);32}33
34public function providers(): iterable35{36yield new Provider('/', $this->path_config->project_dir() . '/templates');37}38}
39