使用twig函数资产生成图像URL

时间:2014-09-09 13:39:59

标签: symfony twig assetic

我想我要问的是可能的。

假设我有一个javascript文件定义了一些jquery默认选项(例如JQGrid)

function defineGridsSettings() {
  $.extend($.jgrid.defaults,{
    jsonReader: {
            root: "rows",
            page: "page",
            total: "total",
            records: "records"
    },
    datatype: 'json',
    mtype: 'GET',
    viewrecords: true,
    imgpath: '../jquery/css/images'
  });
}

我的问题涉及图像文件夹的路径,所以我想使用类似的东西:

{{ asset('bundles/.....') }} for the imgpath

我的文件名是jqueryObjectSettings.js.twig

我使用Assetic加载它......当然,枝条功能没有被翻译。

我可以要求在js文件中翻译枝条指令吗?

谢谢

0 个答案:

没有答案
相关问题