我想在我的php腳本中包含外部js文件。我正在遵循zend framework.Right現在我正在像這樣在控制器的init函數中添加js文件。在zend框架中包含js文件的最佳方式
public function init() {
$this->doUserAuthorisation();
parent::init();
$this->view->headScript()->appendFile($this->view->baseUrl().'/js/front_cal/jquery-1.3.2.min.js');
$this->view->headLink()->setStylesheet($this->view->baseUrl().'/styles/front_cal/calendar.css');
}
問題我正面臨的是,js文件doesnot include.Is這是正確的方式來包含js文件?
嘿,你知道layout.pthml的默認位置?我無法在我的服務器上找到它。 – Xitcod13 2015-01-24 01:43:11
@Xitcod,'Application \ view \ layout \ layout.phtml' – Dennis 2017-08-04 20:56:23