Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在magento管理面板中通过ajax加载phtml_Php_Magento - Fatal编程技术网

Php 如何在magento管理面板中通过ajax加载phtml

Php 如何在magento管理面板中通过ajax加载phtml,php,magento,Php,Magento,如何通过ajax将phtml加载到magento管理面板中?详情如下 \app\design\adminhtml\default\default\layout\layout.xml: <adminhtml_catalog_product_new> <reference name="product_tabs"> <action method="addTab"> <

如何通过ajax将phtml加载到magento管理面板中?详情如下

\app\design\adminhtml\default\default\layout\layout.xml:

<adminhtml_catalog_product_new>
            <reference name="product_tabs">
                <action method="addTab">
                    <name>My_custom_tab</name>
                    <block>listing/adminhtml_catalog_product_tab</block>
                </action>
            </reference>
    </adminhtml_catalog_product_new>

我如何实现这个ajax调用,当触发列表时,内容应该是通过ajax加载的?朋友们,请帮帮我。

它的工作原理与前端相同。你曾经在商店里使用过AJAX吗?固定格式,例如这基本上是在后端添加产品或编辑目录管理下的产品。我以前使用过ajax,但是magento使用它自己的ajax。我想知道它是什么,我知道我的block函数上面的构造方法将自动调用。我想在触发列表选项卡时调用它。Bdw@hakre tnx,请回复。
<div id="customer_info_tabs_customer_edit_tab_action_content">
    <div class="entry-edit">
        <div class="entry-edit-head">
            <h4 class="icon-head head-edit-form fieldset-legend">content</h4>
        </div>
        <div id="group_fields4" class="fieldset fieldset-wide">
            <div class="hor-scroll">
                content body
            </div>
        </div>
    </div>
</div>
     <?php

class Company_Mymodule_Block_Adminhtml_Catalog_Product_Tab extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface
{

    public function _construct()
    {
        parent::_construct();
        $this->setTemplate('Mymodule/catalog/product/tab.phtml');
    }

    public function canShowTab()
    {
        $product = Mage::registry('product');
        //if on edit mode show the tab
        if ($product->getId()) {
            return true;
        }
        $request = Mage::app()->getRequest();
        //if creating product with any attributes, show the tab
        if ($request->getParam('type')) {
            return true;
        }
        return false;
    }

    public function getTabLabel()
    {
        return $this->__('Listing');
    }

    public function getTabTitle()
    {
        return $this->__('Listing');
    }

    public function isHidden()
    {
        return false;
    }
}
 public function getTabUrl()
    {
        return $this->getUrl('*/*/custom', array('_current' => true));
    }

    public function getTabClass()
    {
        return 'ajax';
    }