zenify / modular-presenter-mapping
Modularity for presenter mapping in Nette presenter factory.
Installs: 13 258
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.6
- nette/application: ~2.3
- tracy/tracy: ~2.3
Requires (Dev)
- nette/bootstrap: ~2.3
This package is auto-updated.
Last update: 2022-01-27 10:58:38 UTC
README
Install
Via Composer
$ composer require zenify/modular-presenter-mapping
Register the extension in config.neon
:
extensions: - Zenify\ModularPresenterMapping\DI\ModularPresenterMappingExtension
Usage
To add own presenter mapping, create class that will implement Zenify\ModularPresenterMapping\Contract\Application\PresenterMappingProviderInterface
use Zenify\ModularPresenterMapping\Contract\Application\PresenterMappingProviderInterface; final class MyExtensionPresenterMapping implements PresenterMappingProviderInterface { /** * {@inheritdoc} */ public function provide() { return [ // module => it's namespace, "*" is for presenter name 'PayPal' => 'My\Package\Presenter\*Presenter' ]; } }
Then in redirect:
$this->redirect('PayPal:Payment');
or template:
<a n:href="PayPal:Payment">Pay!</a>
would go to: My\Package\Presenter\PaymentPresenter
.
Testing
$ phpunit
Contributing
Please see CONTRIBUTING for details.