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 Callable Bridge Bundle Laravel Package

covex-nn/twig-callable-bridge-bundle

View on GitHub
Deep Wiki
Context7

Twig Callable Bridge Bundle

Build Status SensioLabsInsight

This Symfony2 bundle aims to provide a simple interface to extend Twig with PHP functions

Installation

Add requirements to composer.json:

{
  "require" : {
    "covex-nn/twig-callable-bridge-bundle" : "~1.0"
  }
}

Register the bundle

Register the bundle in the AppKernel.php file

// ...other bundles ...
$bundles[] = new Covex\TwigCallableBridgeBundle\CovexTwigCallableBridgeBundle();

Configuration

Add the configuration to config.yml

covex_twig_callable_bridge:
    functions:
        uppercase: strtoupper
    filters:
        lowercase: strtolower
    test:
        numeric: is_numeric

Twig

Use your functions, filters and test in Twig templates:

{{ uppercase('qqq') }}
{{ 'WoW'|lowercase }}
{% if 1 is numeric %}yes{% else %}no{% endif %}
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.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver