?我附上Zend的控制器,但空白页一些样式表中所示,我如何包括样式表和Zend的控制器JavaScript文件,这里是我的代码:
public function showAction()
{
//css
$this->viewHelperManager->get('headLink')->appendStylesheet('/css/style.css');
$this->viewHelperManager->get('headLink')->appendStylesheet('/css/bootstrap-theme.min.css');
$this->viewHelperManager->get('headLink')->appendStylesheet('/css/tweaks.css');
$this->viewHelperManager->get('headLink')->appendStylesheet('/css/fullcalendar.css');
$this->viewHelperManager->get('headLink')->appendStylesheet('/css/fullcalendar.print.css');
$this->viewHelperManager->get('headLink')->appendStylesheet('/css/jquery-ui.min.css');
$this->viewHelperManager->get('headLink')->appendStylesheet('/css/jquery.simple-dtpicker.css');
//js
$this->viewHelperManager->get('headScript')->appendFile('/admin_static/js/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js');
$id = (int) $this->params()->fromRoute('id', 0);
if (!$id) {
return $this->redirect()->toRoute('calendar', array(
'action' => 'create'
));
}
$calendar = $id;
$dm = $this->getServiceLocator()->get('doctrine.documentmanager.odm_default');
$eventshow = $dm->createQueryBuilder('Calendar\Document\Calendar')
->hydrate(false)
->field("id")->equals($id)
->getQuery()->execute();
$array = array();
if($eventshow && !is_null($eventshow) && is_object($eventshow)){
foreach($eventshow as $key=>$value) {
$array[] = array(
'calendar_id' => $value['_id'],
'user_id' => $value['user_id'],
'title' => $value['title'],
'description' => $value['description'],
);
}
}
return array('calendar' => $calendar , 'calendardata' => $array);
}