nepada / texy-nette
Texy integration for Nette.
Installs: 10 884
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 1
Open Issues: 0
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
- dev-master / 5.1.x-dev
- v5.1.1
- v5.1.0
- v5.0.2
- v5.0.1
- v5.0.0
- v5.0.0-RC2
- v5.0.0-RC1
- v4.3.0
- v4.2.0
- v4.1.0
- v4.0.0
- v3.6.0
- v3.5.0
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.0
- v2.0.2
- v2.0.1
- v2.0.0
- v1.1.1
- v1.1.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/composer/nepada/coding-standard-7.14.1
- dev-dependabot/composer/phpstan-d283e272d5
This package is auto-updated.
Last update: 2024-10-27 15:56:41 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:customMode
calls$texyMultiplier->processBlock()
|texyLine:customMode
calls$texyMultiplier->processLine()
|texyTypo:customMode
calls$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');