0

我的控制器:

class CronController extends Zend_Controller_Action {
    public function init(){
    }

    public function indexAction(){
        die();
    }

    public function reportAboutExpiringPaymentAction(){
    }
}

我如何调用 reportAboutExpiringPaymentAction() 从file.phtml

4

2 回答 2

0

你需要的方式,根本行不通。在 phtml 上调用此函数的唯一方法是:
URL 如下:http://www.yoursite.com/cron/report-about-expiring-payment
代码是:

class CronController extends Zend_Controller_Action {
    public function init(){
    }

    public function indexAction(){
        die();
    }

    public function reportAboutExpiringPaymentAction(){
        /* YOUR CODE HERE */
        $this->render('file.phtml');
    }
}
于 2013-05-14T17:52:45.923 回答
0

您可以使用View Actions 助手从视图中调用操作。在您的情况下<?php echo $this->action('reportaboutexpiringpayment','cron',null); ?>将执行操作

于 2013-05-15T04:54:21.430 回答