2015-11-06 98 views
0

在ZF2中,我如何將一個變量傳遞給下面的template.phtml?Zend框架 - 如何將變量傳遞給模板?

例如我加載我的template.phtml在主頁下面:

<?=$this->render("layout/forms/template");?> 

其中template.phtml有下面的代碼,但我需要在這裏印的東西,在模板中:通過傳遞價值<?=$this->????????;?><?=$this->render("layout/forms/template");?>

<h1 class="free-trial-title">More Information: <?=$this->????????;?></h1> 
<section class="free-trial-form"> 
    <input type="text" name="txtName" id="txtName" placeholder="Full Name"/><em>*</em><br/> 

    <a class="read-more" id="btnContactMoreInfo" nohref>SUBMIT</a> 

</section> 

如何將主頁中的值傳遞給template.phtml?

回答