Hi i have a controller helper as follow:
<?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;
}
}
and i have a view helper as follow for 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));
}
}
?>
I cant access Application view helper in Application controller helper, where i might be wrong!!
The abstract class
Zend_Controller_Action_Helper_Abstractdoesn’t provide a$viewproperty which reflects the view object that the controller is using.If you want to get access to the view object from your action helper, use the following code:
Once you have that you should be able to call your view helper like: