Twig.AspNetCore 3.0.3

Package Description

Install-Package Twig.AspNetCore -Version 3.0.3
dotnet add package Twig.AspNetCore --version 3.0.3
<PackageReference Include="Twig.AspNetCore" Version="3.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Twig.AspNetCore --version 3.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Twig for .NET

The project provides PHP's Twig library for .NET.

The Twig library is developed at https://github.com/twigphp/Twig/

Basic usage

Add package reference to your Web Application

<PackageReference Include="Twig.AspNetCore" Version="3.0.3" />

or

dotnet add package Twig.AspNetCore -v 3.0.3

Render Twig template in a razor page

@{
    ViewData["Title"] = "My Twig Page";
}

@Html.Twig("/path/to/templates", "index.html", new { name = "John Doe", });

Repository structure

  • Twig.Twig: contains the Twig library.
  • Twig.AspNetCore: provides helpers for Razor pages.
  • Twig.AspNetCore.Demo: a sample ASP.NET Core website rendering a twig template

How it works

The unmodified PHP code is compiled to .NET assembly using PeachPie PHP Compiler. Resulting library can be seamlessly referenced by other .NET projects (C#, VB.NET, F#), used for rendering Twig e.g. within ASP.NET Core pages.

Twig for .NET

The project provides PHP's Twig library for .NET.

The Twig library is developed at https://github.com/twigphp/Twig/

Basic usage

Add package reference to your Web Application

<PackageReference Include="Twig.AspNetCore" Version="3.0.3" />

or

dotnet add package Twig.AspNetCore -v 3.0.3

Render Twig template in a razor page

@{
    ViewData["Title"] = "My Twig Page";
}

@Html.Twig("/path/to/templates", "index.html", new { name = "John Doe", });

Repository structure

  • Twig.Twig: contains the Twig library.
  • Twig.AspNetCore: provides helpers for Razor pages.
  • Twig.AspNetCore.Demo: a sample ASP.NET Core website rendering a twig template

How it works

The unmodified PHP code is compiled to .NET assembly using PeachPie PHP Compiler. Resulting library can be seamlessly referenced by other .NET projects (C#, VB.NET, F#), used for rendering Twig e.g. within ASP.NET Core pages.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
3.0.3 257 4/7/2020
3.0.3-preview2 107 6/19/2020
3.0.3-preview1 96 5/4/2020
3.0.1 121 1/12/2020