在任何地方都没有使用的例子,甚至没有关于如何使用它的说明。
答案 0 :(得分: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 }
答案 1 :(得分:2)
我知道这个问题有它的年龄,但我认为这个问题对我们很多人来说仍然存在:)
几个小时后,我的头靠在墙上,我想和你分享一些信息:P
如何在symfony here中使用use_dynamic_javascript()帮助器。
答案 2 :(得分:0)
显然,这个帮助器将非静态(由你生成)JS添加到响应中。第一个参数是一个url,就像传递了url_for()
一样。