mezzio / mezzio-platesrenderer

Plates integration for Mezzio
https://docs.mezzio.dev/mezzio/features/template/plates/
BSD 3-Clause "New" or "Revised" License
4 stars 8 forks source link

Allow `'plates'` configuration to define its own file extension #20

Closed alexander-schranz closed 2 years ago

alexander-schranz commented 2 years ago

Signed-off-by: Alexander Schranz alexander@sulu.io

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC no
QA no

Description

Currently it is not possible to use twig and plates side by side as the "global" config extension config doesn't allow it. Why I personally would remove things like paths, extension into a plates specific config and not "abstract" it I did for bc reasons just make it possible to overwrite things like its done in twig renderer.

In twig such config already possible as twig config overwrite the templates configuration here the same way: https://github.com/mezzio/mezzio-twigrenderer/blob/57f301d01181f96f1379b8397ca285b856622efc/src/TwigRendererFactory.php#L59-L66

Example:

class ConfigProvider
{
    public function __invoke(): array
    {
        return [
            // ...
            'plates' => [
                'extension' => 'php',
            ],
            'twig' => [
                'extension' => 'html.twig',
            ],
        ];
    }
}

TODO

alexander-schranz commented 2 years ago

@Ocramius I have again problem to update the psalm baseline, still have errors in the CI after update. Not sure why 🙈

Ocramius commented 2 years ago

@alexander-schranz try

docker run --rm -ti -v $(pwd):/app -w /app php:7.4 ./vendor/bin/psalm --no-cache --set-baseline=psalm-baseline.xml
Ocramius commented 2 years ago

:ship:

alexander-schranz commented 2 years ago

Thank you!