Magento中后台form表单中的页面跳转

这里我使用ticket页中点击order_no进入order详情页作为例子,代码如下:
Block/Adminhtml/Ticket/Edit/Tab/Form.php

$ticketData = Mage::registry ( 'fun_ticket' );
$orderData = Mage::getModel ( 'fun_sales/order' )->load ($ticketData['order_no'], 'increment_id');
if ($orderData['entity_id']) {
    $fieldset->addField ( 'order_no', 'link', array (
         'label'  => Mage::helper ( 'fun_ticket' )->__ ( 'Order No' ),
         'name'   => 'order_no',
         'href'   => $this->getUrl ( 'adminhtml/sales_order/view', array (
             'order_id' => $orderData['entity_id']
         ) ),
         'target' => '_blank'
    ) );
} else {
    $fieldset->addField ( 'order_no', 'label', array (
        'label' => Mage::helper ( 'fun_ticket' )->__ ( 'Order No' ),
        'name'  => 'order_no',
    ) );
}
'href' => $this->getUrl ( 'adminhtml/sales_order/view', array (
                  'order_id' => $orderData['entity_id']
              ) ),

这里getUrl()方法中第一个参数是要跳转的路径,第二个参数是要传递的参数

你可能感兴趣的:(Magento杂谈)