2

I'm using this module https://github.com/widmogrod/zf2-mustache-module

module.config

'strategies' => array(
    'Mustache\View\Strategy'
),

'template_map' => array(
    'My_Main' => __DIR__ . '/../view/main.phtml',
    'My_SideBar'  => __DIR__ . '/../view/partials/templates.mustache',
),

'mustache' => array(
    'partials_loader' => array(__DIR__ . '/../view/partials'),
),

templates.mustache

<div>
<p>Book Title: {{ title }}</p>
</div>

main.phtml view

<?php 
echo $this->partial('My_SideBar', array('title' => 'My partial'));
?>

Output: Book Title : {{ title }}

Defyleiti
  • 535
  • 1
  • 7
  • 23

0 Answers0