php - Magento - Need to launch model from html button press -


i've got simple html button in tha admin area (custom module) need "launch" model function , pass variable.

which best way?

dispatch event , observe it? other simpler way?

the best approach create own controller , action.
when click button, send request controller , action parameter (post or get) , in action add this:

$param = mage::app()->getrequest()->getparam('some_param');//get parameter //or //$param = mage::app()->getrequest()->getpost('some_param');//get parameter post mage::getmodel('some/model')->dosomeaction($param); $this->_redirectreferer(); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -