【问题标题】:add/call widget in default.tpl layout socialengine在 default.tpl 布局 socialengine 中添加/调用小部件
【发布时间】:2014-08-01 01:31:36
【问题描述】:

我是 Zend 和社交引擎编程新手。我有如下 default.tpl 布局:

  <body id="global_page_<?php echo $identity ?>">
  <div id="global_header">
    <?php echo $this->content('header') ?>
  </div>
  <div id='global_wrapper'>
    <div id='global_content'>
      <div class="new class contain widget">

      </div>
        <?php //echo $this->content('global-user', 'before') ?>
        <?php echo $this->layout()->content ?>
        <?php //echo $this->content('global-user', 'after') ?>
    </div>
  </div>
  <div id="global_footer">
    <?php echo $this->content('footer') ?>
  </div>
  <div id="janrainEngageShare" style="display:none">Share</div>
</body>

我想添加/调用小部件并将其放在&lt;div class="new class contain widget"&gt; &lt;/div&gt; 标签内。例如,我想在这个 html 标记内从核心模块添加小部件菜单主和搜索小部件,我该如何实现呢?需要你的帮助。

【问题讨论】:

    标签: php zend-framework socialengine


    【解决方案1】:

    这很简单。 使用以下代码,将 core.menu-main 替换为小部件的名称:

    <div class="new class contain widget">
        <?php echo $this->content()->renderWidget("core.menu-main"); ?>
    </div>
    

    【讨论】:

    • 如何设置小部件的配置??
    猜你喜欢
    • 1970-01-01
    • 2014-10-17
    • 2018-02-14
    • 1970-01-01
    • 2016-04-13
    • 2018-08-14
    • 1970-01-01
    • 1970-01-01
    • 2016-11-26
    相关资源
    最近更新 更多