Skip to content

scotteuser/twigcs-fractal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Twigcs Fractal

This extends the excellent Twigcs to provide a ruleset for the Fractal Render component.

Installation

This is available as a package on packagist: https://packagist.org/packages/scotteuser/twigcs-fractal

composer require scotteuser/twigcs-fractal

What does this do?

Consider the following Fractal code:

{% set card_label = 'Hello' %}
{% render "@card" with {
  label: card_label
} %}

Twigcs by default will consider card_label as an unused variable because it does not know of Fractal's render tag.

How do you use it?

Add a file .twig_cs.dist to your project root and change your project to use this ruleset.

<?php

return \FriendsOfTwig\Twigcs\Config\Config::create()
    ->setRuleSet(ScottEuser\FractalTwigcs\Ruleset\Fractal::class);

About

Fractal Ruleset for TwigCS (https://github.com/friendsoftwig/twigcs)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages