How to use the partial in zendframework2
问题 In ZF1 we use partial in layout.phtml file something like that $this->partial('header.phtml', array('vr' => 'zf2')); How we can do the same in ZF2? 回答1: this can be achieved by echo $this->partial('layout/header', array('vr' => 'zf2')); you can access the variable in view using echo $this->vr; don't forget to add following line in your view_manager of module.config.php file. 'layout/header' => __DIR__ . '/../view/layout/header.phtml', after adding it looks like this return array( 'view