How do I use shared view script paths for partials in Zend Framework 2? -
i'm using zend framework 2 (v2.1.4) , have partials template want use in several modules. according the documentation can access partials in other modules, but
that said, it’s better practice put re-usable partials in shared view script paths.
this sounds idea, can't find documentation on "share view script path". find it, , when i've set it, how tell partial()
helper use them?
in module.config.php
'view_manager' => array( 'template_path_stack' => array( 'mymodule' => __dir__ . '/../view', ), 'template_map' => array( 'snippets/mypartial' => __dir__ . '/../view/snippets/mypartial.phtml', ), ),
and use that
<?php echo $this->partial("snippets/mypartial"); ?>
Comments
Post a Comment