2009-06-18 119 views

回答

3

這是源代碼,用它做什麼。 (不會出現過於有用的IMO)。

566 /** 
567 * Adds a dynamic javascript to the response object. 
568 * 
569 * The first argument is an internal URI. 
570 * The helper automatically adds the sf_format to the internal URI, so you don't have to. 
571 * 
572 * @see sfResponse->addJavascript() 
573 */ 
574 function use_dynamic_javascript($js, $position = '', $options = array()) 
575 { 
576 $options['raw_name'] = true; 
577 
578 return use_javascript(_dynamic_path($js, 'js'), $position, $options); 
579 } 
+0

謝謝伊恩!我只是好奇,是否足以顯着幫助構建動態JavaScript的過程。 – 2009-06-18 03:44:30

2

我知道這個問題有它的年齡,但我考慮的問題仍然存在,對於我們許多人:)

的敲我的頭撞在牆上幾個小時後,我想與大家分享一些信息你:P

如何在symfony中使用use_dynamic_javascript()助手here

0

很顯然,這個幫助器會將JS的非靜態(由您生成)添加到響應中。第一個參數是一個url,就好像它已通過url_for()