一意のJavaScriptファイルを分割して、アクションごとにファイルを取得したいと思います。私のコントローラーでは、jQuery()-> addJavascriptFile()を使用してjsファイルを呼び出します。
class DemandesController extends Zend_Controller_Action
{
public function init()
{
$this->view->jQuery()->addJavascriptFile('public/js/' . $this->getRequest()->getControllerName() . '/' . $this->getRequest()->getActionName() . '.js');
}
}
私のpublic/jsフォルダーには、コントローラーごとのフォルダーとアクションごとのjsファイルがあります...これはindexActionでのみうまく機能し、他のすべてのフォルダーでは、コントローラーの名前がURIに挿入されます:with indexAction:http: //192.168.78.208/demande_absence/public/js/demandes/index.js 他の場合:http : //192.168.78.208/demande_absence/demands /public/js/demandes/nouvelle.js
私が間違ったことは何ですか?