webnoob
webnoob

Reputation: 15934

Calling a function in Magento Admin Module Controller via URL

I was under the impression (after viewing some tutorials on Alan Storms site about Models) that I should be able to call a function on my controller via a url like so:

http://www.localhost.com:8080/magento/index.php/mymodule/adminhtml_mymodule/someFunction

and in the controller declare:

public function someFunctionAction()
{
    Mage::log("Im In");
}

The problem is that nothing is being logged. Is there something special with admin modules that prevents this from working?

Note: I haven't included the rest of my code for declaring the module as everything is working fine, I am merely curious about calling the controller function via the Url in this way but please let me know if you require more information in order to answer it properly.

Upvotes: 1

Views: 4397

Answers (2)

Deepak Mallah
Deepak Mallah

Reputation: 4076

Try this, if your controller name is poductController than in URL use product

http://www.localhost.com:8080/magento/index.php/mymodule/product/someFunction

Upvotes: 0

peter gunn
peter gunn

Reputation: 456

You can't call your action with the direct URL, because Magento uses nonces in the admin section. You can read about this here: http://alanstorm.com/magento_admin_hello_world_revisited , look for the "Magento Admin URLs"-section.

Upvotes: 1

Related Questions