【问题标题】:Magento - How to render a page in popup or dialog?Magento - 如何在弹出窗口或对话框中呈现页面?
【发布时间】:2016-01-06 01:18:09
【问题描述】:

我想在所有页面中将 .phtml 文件呈现为弹出窗口或对话框,或者如何将页面加载转换为弹出窗口或对话框。 有什么办法解决。

【问题讨论】:

    标签: magento dialog popup php


    【解决方案1】:

    我以前用过这个:

    <?php
    require_once('app/Mage.php');
    umask(0);
    
    $layout = Mage::app()->getLayout();
    $layout->getUpdate()->addHandle('default')->load();
    $layout->generateXml()->generateBlocks();
    
    Mage::getDesign()->setTheme('mytheme');
    
    $layout->getBlock('head')->setTitle('Regular Post Delivery Details');
    
    echo '<html><head>';
    echo $layout->getBlock('head')->toHtml();
    echo '</head>';
    echo '<body><div class="special-content">';
    
    echo $layout
        ->createBlock('cms/block')
        ->setBlockId('estimated-regular-delivery-times')
        ->toHtml();
    
    echo '</div></body></html>';
    ?>
    

    只需在您的网络根目录中创建一个 php 文件即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-24
      • 1970-01-01
      • 2012-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-21
      • 1970-01-01
      相关资源
      最近更新 更多