Skip to content

Twig templating support for Kirby CMS

License

Notifications You must be signed in to change notification settings

eQRoeil/kirby-twig

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twig Plugin for Kirby CMS

  • Adds support for Twig templates to Kirby CMS (2.3+).
  • PHP templates still work, you don’t have to rewrite them if you don’t want to.

What it looks like

Before:

<?php /* site/templates/hello.php */ ?>
<h1><?php echo $page->title() ?></h1>
<?php echo $page->text()->markdown() ?>

After:

{# site/templates/hello.twig #}
<h1>{{ page.title }}</h1>
{{ page.text.markdown | raw }}

Installation

If you’re using Kirby’s CLI, you can install with:

kirby plugin:install fvsch/kirby-twig

For manual installation:

  1. Download the latest release and put it in your site/plugins folder.
  2. Rename the copied folder to twig (it should be named site/plugins/twig).
  3. To activate the plugin, put c::set('twig', true); in your site/config/config.php.

You can now create .twig templates in your site/templates directory.

Documentation

Credits

About

Twig templating support for Kirby CMS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%