- jquery觸發submit
$('form:first').trigger("submit");
- url路徑
//根目錄 - 從web root到public
$this->baseUrl('course/add'); //參數加入即會自動補
=>/myweb/public/course/add - 目前url
$this->url(array('controller'=>'course','action'=>'add')); //如果當前的url是在同一個controller下的話,可以不用給controller參數
=>/myweb/public/course/add/ - Controller, Action Name及參數
$request = Zend_Controller_Front::getInstance()->getRequest();
$controllerName = $request->getControllerName();
$actionName = $request->getActionName();
$paramArray = $request->getParams();
$params = '';
foreach($paramArray as $key => $value)
$params .= $key . "/" . $value; - 添加CSS 和 JS
//將js,css放在public裡的js,css資料夾
<script type="text/javascript" src="<?php echo $this->baseUrl('js/jquery-xxx.min.js');? >" >
</script?>
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl('css/xxx.css'); ? >" >
Zend - Get everything after base Url (Controller, Action, and any params)
沒有留言:
張貼留言