omegacode / symfony-fluid-integration
Integrates the template engine fluid into symfony 4 projects.
Installs: 71
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- kint-php/kint: ^2.2
- symfony/framework-bundle: ^4.1
- symfony/templating: ^4.1
- symfony/yaml: ^4.1
- typo3fluid/fluid: ^2.5
Requires (Dev)
README
! This is currently work in progress. !
Description
Integrates the template engine fluid into symfony 4 projects.
Setup
Open the file config/services.yaml
and add the following:
services: templating.engine.fluid: public: true autowire: true class: OmegaCode\FluidIntegration\FluidEngine arguments: - '@kernel' - '@omega_code_fluid_integration.settings'
Next, open the file config/packages/framework.yaml
and add the following:
framework: templating: engines: ['fluid', 'twig', 'php']
Finally open the file config/bundles.php
and add the bundle:
<?php return [ ... OmegaCode\FluidIntegration\OmegaCodeFluidIntegrationBundle::class => ['all' => true], ... ];
You are now able to render fluid templates in your controller:
class DemoController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController { public function indexAction() { return $this->render('demo/index.html', [ 'var' => 'val' ]); } }
View helper - Auto complete for your IDE
To enable auto complete in your IDE for the custom symfony-fluid-integration view helpers,
add the following URL:http://omega-code.de/ViewHelperSchemas/schema.xsd