在我的插件观察者中,我想调用控制器动作,但我不知道,我搜索了很多,但没有找到任何可行的解决方案。我也试过这个 -
public function proccessFeeds()
{
//this i have added to call controller
$url = "www.example.com";
Mage::app()->getResponse()->setRedirect($url);
if ($this->_isWrongTimeStamp()) {
// Handle the exit
return;
}
$collection = Mage::getResourceModel('ranvi_feed/item_collection')
->addFieldToFilter('restart_cron', '1')
->addFieldToFilter('upload_day', array(
'like' => '%' . strtolower(date('D')) . '%'
));
foreach ($collection as $feed) {
try {
/** @var $feed Ranvi_Feed_Model_Item */
$feed->generateFeed();
$feed->clearInstance();
unset($feed);
// }
} catch (Exception $e) {
$feed->setData('restart_cron', intval($feed->getData('restart_cron')) + 1);
$feed->save();
continue;
}
}
}
但似乎这不正确。