嗨,我有一个控制器助手如下:
<?php
class Application_Controller_Helper_GetEventDetail extends Zend_Controller_Action_Helper_Abstract
{
public function direct($eventDetail)
{
return $this->getEventDetail($eventDetail);
}
public function getEventDetail($event_id)
{
$eventMapper = new Application_Model_Mapper_EventMapper();
$eventDetails = $eventMapper->findById($event_id);
$eventDate = $this->view->getEventTime($eventDetails[0]['date_from'],$eventDetails[0]['date_to']);
$result = array(
'event' => $eventDetails,
'when' => $eventDate
);
return $result;
}
}
我有一个视图助手如下getEventTime
<?php
class Application_View_Helper_GetEventTime extends Zend_View_Helper_Abstract
{
public function getEventTime($fromdate,$todate)
{
//echo $to; exit;
return date("j F Y, H:m a",strtotime($fromdate))."-<br/>".date("j F Y, H:m a",strtotime($todate));
}
}
?>
我无法在应用程序控制器助手中访问应用程序视图助手,我可能错了!