Code Monkey home page Code Monkey logo

Comments (1)

fvsch avatar fvsch commented on June 16, 2024

Okay, I think the issue is that since 3.0.0, when installed with the zip download or Kirby’s CLI, the plugin is automatically registered. That’s the way most Kirby plugins work, including the Blade plugin.

See the install section:
https://github.com/fvsch/kirby-twig#installation
And the plugin’s main script:
https://github.com/fvsch/kirby-twig/blob/master/twig.php
You only have to use the Kirby\Twig\Plugin::register method when installing the plugin with Composer.

The Blade plugin is doing roughly the same thing:
https://github.com/pedroborges/kirby-blade-template/blob/master/blade.php

The reason that the Blade plugin doesn’t work with the Twig plugin also enabled is that you can only register one template component, and since plugins are loaded in alphabetical order, so this is what happens:

$kirby->set('component', 'template', PedroBorges\Blade\Template::class);
$kirby->set('component', 'template', 'Kirby\Twig\TwigComponent');

The second call overwrites the first one, so Blade is not used.

If you want to keep the Twig plugin around (in your site/plugins folder) but disable it, you can edit site/plugins/twig/twig.php to comment out the call to Kirby\Twig\Plugin::register.
Alternatively, just rename that file to twig.php.disabled and Kirby won’t load it.

from kirby-twig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.