PHP code example of hrevert / ht-template-resolver-module

1. Go to this page and download the library: Download hrevert/ht-template-resolver-module library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hrevert / ht-template-resolver-module example snippets


  
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 
    }
}



return [
    'ht_template_resolver' => [
        'resolvers_plugin_manager' => [
            'invokables' => [
                'my_resolver' => 'Application\View\Resolver\MyResolver',
            ]
        ]
    ]
];


return [
    'ht_template_resolver' => [
        'resolvers' => [
            'my_resolver' => 200, // 200 means priority, the resolvers with highest priority are consulted first
        ]
    ]
];