nepada / texy-nette
Texy integration for Nette.
Installs: 18 888
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/nepada/texy-nette
Requires
- php: >=8.1.0 <8.5
- nette/utils: ^3.2@dev || ^4.0@dev
- texy/texy: ^3.1.6@dev
Requires (Dev)
- latte/latte: ^3.0@dev
- nepada/coding-standard: 7.14.0
- nepada/phpstan-nette-tester: 1.2.1
- nette/application: >=3.1.10
- nette/bootstrap: >=3.1@dev
- nette/di: ^3.0.6@dev
- nette/http: *@dev
- nette/neon: >=3.3.4@dev
- nette/robot-loader: *@dev
- nette/schema: ^1.0.3@dev
- nette/tester: 2.5.4
- php-parallel-lint/php-parallel-lint: 1.4.0
- phpstan/phpstan: 1.12.5
- phpstan/phpstan-nette: 1.3.8
- phpstan/phpstan-strict-rules: 1.6.1
- shipmonk/phpstan-rules: 3.2.1
- spaze/phpstan-disallowed-calls: 3.4.0
Suggests
- latte/latte: to use Latte with custom Texy! macros in templates
- nette/di: for integration with Nette DI container
Conflicts
- latte/latte: <3.0.0
This package is auto-updated.
Last update: 2025-10-11 06:53:02 UTC
README
Installation
Via Composer:
$ composer require nepada/texy-nette
Register the extension in config.neon:
extensions: texy: Nepada\Bridges\TexyDI\TexyExtension
Usage
Configuration
This extension contains simple Texy factory that only creates new instance of Texy\Texy.
Usually you will want to define your own factory by implementing Nepada\Texy\TexyFactory, often more than one.
texy: factories: 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
There are 2 new tags for processing blocks and single lines, both with possibility to specify a custom mode:
{texy fooMode}
    - one
    - two
{/texy}
<p>
    {texyLine barMode}Whatever...{/texyLine}
</p>
Alternatively, you can use one of 3 filters to achieve similar result:
- |texy:customModecalls- $texyMultiplier->processBlock()
- |texyLine:customModecalls- $texyMultiplier->processLine()
- |texyTypo:customModecalls- $texyMultiplier->processTypo()
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:
$multiplier->processBlock($text, 'myMode'); $texy = $multiplier->getTexy('myMode');