hrevert / ht-template-resolver-module
HtTemplateResolverModule is a Zend Framework 2 module which allows us to easily create custom template path resolvers
0.0.1
2014-03-26 15:29 UTC
Requires
- php: >=5.4
- zendframework/zend-modulemanager: ~2.2
- zendframework/zend-mvc: ~2.2
- zendframework/zend-servicemanager: ~2.2
- zendframework/zend-view: ~2.2
This package is auto-updated.
Last update: 2024-12-13 03:13:00 UTC
README
HtTemplateResolverModule is a Zend Framework 2 module which allows us to easily create custom template path resolvers
DEPRECATED
This module is deprecated. Please use Delegator service factories to create custom template path resolvers.
##Requirements
- Zend Framework 2
- PHP (>=5.4)
Installation
- Add
"hrevert/ht-template-resolver-module": "0.0.*",
to your composer.json and runphp composer.phar update
- Enable the module in
config/application.config.php
Basic Usage
- Create a class imlements that Zend\View\Resolver\ResolverInterface
<?php namespace Application\View\Resolver; use Zend\View\Resolver\ResolverInterface; use Zend\View\Renderer\RendererInterface as Renderer; class MyResolver implements ResolverInterface { public function resolve($name, Renderer $renderer = null) { // write your code here } }
- Now inform the resolvers plugin manager about our new resolver.
<?php return [ 'ht_template_resolver' => [ 'resolvers_plugin_manager' => [ 'invokables' => [ 'my_resolver' => 'Application\View\Resolver\MyResolver', ] ] ] ];
- Now, tell the AggregateResolver to use our new resolver.
<?php return [ 'ht_template_resolver' => [ 'resolvers' => [ 'my_resolver' => 200, // 200 means priority, the resolvers with highest priority are consulted first ] ] ];