Magento 使用Ajax异步处理教程//setTemplate('/aa/bb/xxx.ph
Magento 通过xxAction改变模板
public function profileAction() { $this->loadLayout();
public function showAction()
上面 showAction() 都是加载 SALES.XML 来进行配制的。。。 <adminhtml_customer_show>
public function timeAction()
Magento AJAX应用程序大概思路基本如下: 调用Magento AJAX主要去掉多余不想要的block结点数据,比如header,footer,left,right 1.通过controller修改配置文件的handle输出结果 protected function loadPage() { $layout = $this->getLayout(); $update = $layout->getUpdate(); $update->load('your_custom_handle'); $layout->generateXml(); $layout->generateBlocks(); $output = $layout->getOutput(); $result = array( 'outputHtml' => $output, 'otherVar' => 'foo', ); $this->getResponse()->setBody(Zend_Json::encode($result)); } 2.LAYOUT配置文件 <your_custom_handle> <remove name="head"/><!--去掉头部结点--> <remove name="right"/><!--去掉右边结点--> <remove name="left"/><!--去掉左边结点--> <block type="module/block" name="root" output="toHtml" template="module/template.phtml"/> </your_custom_handle> 这样就可以输出内容返回给前端处理 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |