0

I want to call my custom adminhtml controller on form action. see my config file admin please and how to call controller.

<?xml version="1.0"?>
<config>
  <modules>
    <Mage2sol_Trackinglink>
      <version>0.1.0</version>
    </Mage2sol_Trackinglink>
  </modules>
  <global>
    <helpers>
      <trackinglink>
        <class>Mage2sol_Trackinglink_Helper</class>
      </trackinglink>
    </helpers>
    <blocks>
      <trackinglink>
        <class>Mage2sol_Trackinglink_Block</class>
      </trackinglink>
    </blocks>
    <models>
      <trackinglink>
        <class>Mage2sol_Trackinglink_Model</class>
        <resourceModel>trackinglink_mysql4</resourceModel>
      </trackinglink>
      <trackinglink_mysql4>
        <class>Mage2sol_Trackinglink_Model_Mysql4</class>
        <entities>        
              <tracklink>
                <table>tracklink</table>
              </tracklink>
        </entities>
      </trackinglink_mysql4>
    </models>
    <resources>
      <trackinglink_setup>
        <setup>
          <module>Mage2sol_Trackinglink</module>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </trackinglink_setup>
      <trackinglink_write>
        <connection>
          <use>core_write</use>
        </connection>
      </trackinglink_write>
      <trackinglink_read>
        <connection>
          <use>core_read</use>
        </connection>
      </trackinglink_read>
    </resources>
  </global>
  <admin>
    <routers>
      <trackinglink>
        <use>admin</use>
        <args>
          <module>Mage2sol_Trackinglink</module>
          <frontName>admin_trackinglink</frontName>
        </args>
      </trackinglink>
    </routers>
  </admin>
  <adminhtml>
    <menu>
      <trackinglink module="trackinglink">
        <title>Trackinglink</title>
        <sort_order>100</sort_order>
        <children>
          <tracklink module="trackinglink">
            <title>Manage Tracklink</title>
            <sort_order>10</sort_order>
            <action>admin_trackinglink/adminhtml_tracklink</action>
          </tracklink>
        </children>
      </trackinglink>
    </menu>
    <acl>
      <resources>
        <all>
          <title>Allow Everything</title>
        </all>
        <admin>
          <children>
            <trackinglink translate="title" module="trackinglink">
              <title>Trackinglink</title>
              <sort_order>1000</sort_order>
              <children>
          <tracklink translate="title">
            <title>Manage Tracklink</title>
            <sort_order>10</sort_order>
          </tracklink>
              </children>
            </trackinglink>
          </children>
        </admin>
      </resources>
    </acl>
    <layout>
      <updates>
        <trackinglink>
          <file>trackinglink.xml</file>
        </trackinglink>
      </updates>
    </layout>
    <events>
            <core_block_abstract_to_html_after>
                <observers>
                    <trackinglink_custom_order_view_info>
                        <class>trackinglink/observer</class>
                        <method>getSalesOrderViewInfo</method>
                    </trackinglink_custom_order_view_info>
                </observers>
            </core_block_abstract_to_html_after>
        </events>
  </adminhtml>
</config> 

2 Answers 2

0

Please use this action url to get admin controller form action -

<form action="<?php echo Mage::helper('adminhtml')->getUrl('*/adminhtml_tracklink/your_form_action'); ?>" name="trackinglink" method="post">
0

Generally admin url's are working with secret code.

$url = Mage::helper("adminhtml")->getUrl("admin_trackinglink/<your_action_name>")

When we using above code. The secret key will automatically be added to the URL.

<form action="<?php echo $url; ?>" method="POST">

you give as first parameter a route with a controller, where the method is just waiting for a controller name.

DON'T USE anything else than adminhtml/ as start of the url, because magento 1.9.2.2 forbids everything else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.