ModularPresenterMapping
, (*1)
Install
Via Composer, (*2)
$ composer require zenify/modular-presenter-mapping
Register the extension in config.neon:, (*3)
extensions:
- Zenify\ModularPresenterMapping\DI\ModularPresenterMappingExtension
Usage
To add own presenter mapping, create class that will implement Zenify\ModularPresenterMapping\Contract\Application\PresenterMappingProviderInterface, (*4)
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:, (*5)
$this->redirect('PayPal:Payment');
or template:, (*6)
<a n:href="PayPal:Payment">Pay!</a>
would go to: My\Package\Presenter\PaymentPresenter., (*7)
Testing
$ phpunit
Contributing
Please see CONTRIBUTING for details., (*8)