Texy integration for Nette

Build Status Coverage Status Downloads this Month Latest stable


Via Composer:

$ composer require nepada/texy-nette

Register the extension in config.neon:

    texy: Nepada\Bridges\TexyDI\TexyExtension

This extension relies on nepada/template-factory - make sure you've enabled it as well.



This extension contains simple Texy factory that only creates new instance of Texy\Texy and sets output mode to HTML5.

Usually you will want to define your own factory by implementing Nepada\Texy\ITexyFactory, often more than one.

        foo: @fooTexyFactory
        bar: @barTexyFactory

    defaultMode: foo

This example adds two custom factories. Note the names foo and bar - we call these Texy "modes". In different parts of your application you might need to use different mode (i.e. differently configured instance of Texy).

In templates

Latte templates come with a couple of filters that you can use:

  • |texy calls $texy->process()
  • |texyLine calls $texy->processLine()
  • |texyTypo calls $texy->processType()

If you need to switch between different Texy modes, wrap your code into macro {texyMode modeName}...{/texyMode}. A good practice is to always use this macro and not rely on the default mode.

In presenters and other controls

The preferred way is to inject Nepada\Texy\TexyMultiplier instance wherever you need it, and either use it directly or pull out desired Texy instance, e.g:

$texy = $multiplier->getTexy('myMode');
  • v3.3.0 3.3.0

    • Requires Nette 3.0 (Nette 2.4 support was dropped).
    • Requires Texy 3.0 (Texy 2.8 support was dropped).
  • v3.2.0 3.2.0

    • Nette 3 compatibility.
  • v3.1.0 3.1.0

    • Fixed compatibility with Latte 2.5
    • Support Texy 3
    • CI improvements
  • v3.0.0 3.0.0

    • Improved type safety.
    • Refactored exception hierarchy (drop marker interface, use standard exceptions instead of custom InvalidStateException) - unlikely, but possible BC break.
  • v2.0.2 2.0.2

    • Code style improvements.
  • v2.0.1 2.0.1

    • PHP 7.2 compatibility.
  • v2.0.0 2.0.0

    • Requires PHP 7.1.
    • Uses declare(strict_types = 1).
    • Uses scalar and return type hints.
    • Compatible with PHP 7.2.
  • v1.1.1 1.1.1

    • Code style improvements.
  • v1.1.0 1.1.0

    • Requires Nette 2.4.
    • Compatible with Latte 2.4.
  • v1.0.4 1.0.4

    • Code style improvements.
  • v1.0.3 1.0.3

    • Added TexyMultiplier::getOutputMode().
  • v1.0.2 1.0.2

    • 1.0.x conflicts with Latte >=2.4.
  • v1.0.1 1.0.1

    • Forward compatibility with Latte 2.4.
  • v1.0.0 1.0.0

    • Initial release.

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette