Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Twig Jack Bundle Laravel Package

boekkooi/twig-jack-bundle

View on GitHub
Deep Wiki
Context7

Twig Syntax Validator

This Twig Syntax Validator adds an validation constraint that will validate a string as containing valid twig syntax.

Example

Enable the validator

# app/config/config.yml
boekkooi_twig_jack:
    ...
    constraint: true

Use the constraint.

use Boekkooi\Bundle\TwigJackBundle\Validator\Constraint as TwigAssert;
use Symfony\Component\Validator\Constraints as Assert;

class MyClass {
    // ...

    /**
     * [@Assert](https://github.com/Assert)\NotBlank()
     * [@TwigAssert](https://github.com/TwigAssert)\TwigSyntax()
     */
    public $template;

    /**
     * Check this variable based on syntax only and not availability of the methods, filters, etc. used
     *
     * [@Assert](https://github.com/Assert)\NotBlank()
     * [@TwigAssert](https://github.com/TwigAssert)\TwigSyntax(parse=false)
     */
    public $remote_template;

    // ...
}

Full configuration

Default configuration:

# app/config/config.yml
boekkooi_twig_jack:
    constraint:
        enabled: true
        environment: 'twig' # Reference to the twig environment service to use by default.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
graham-campbell/flysystem
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi