dek-cz / title-control
Nette control for managing title in HTML header.
Installs: 5 305
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.4.0
- nette/application: ^3.0@dev
- nette/utils: ^3.1.3@dev
Requires (Dev)
- ninjify/qa: ^0.12.1
- php-coveralls/php-coveralls: ^2.4
- phpstan/phpstan: ^0.12.69
- phpstan/phpstan-nette: ^0.12.14
- phpstan/phpstan-strict-rules: ^0.12.9
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- spaze/phpstan-disallowed-calls: ^1.1
README
Installation
Via Composer:
$ composer require dek-cz/title-control
Usage
First register the control factory in your config:
services: - implement: Dekcz\TitleControl\ITitleControlFactory
Use the control factory in your presenter:
protected function createComponentTitle(): Dekcz\TitleControl\TitleControl { $control = $this->titleControlFactory->create(); $control->setTitle('My title'); return $control; }
And render it in your Latte template:
<html> <head> {control title} </head> <body> ... </body> </html>
We can also use multi title with a separator. Default separator is: ' | '
$control->addItem('One')->addItem('Two'); // 'One | Two'
Change the separator:
$control->setSeparator(' ~ ');
We can also use nette translator