twig - 使用 jQuery 将变量移动到另一个 html 并加载它
问题描述
我正在使用 twig 来获取渲染数据。这是我的代码:
function addProduct(product_id, product_image, product_name) {
product_ids.push(parseInt(product_id));
// console.log(file_id);
$.each(product_ids, function (i, val) {
products[i]= {id: product_id, image: product_image, name: product_name};
})
console.log(products);
$("#search-pop").slideUp();
$(".list-selected-product").append(
{% include '_layout/include/_render_product_select.html.twig' with {'products': products} %}
);
// console.log($(".list-selected-product").html(products));
}
现在我想 render_product_select 但我不知道如何将产品传输到此。请帮我!非常感谢。
解决方案
推荐阅读
- winapi - CF_DIBV5 的 Windows 剪贴板 ::GetClipboardData() 导致剪贴板上的图像被修改和损坏?
- swift - SpriteKit 节点穿墙
- java - java.lang.NoClassDefFoundError:解析失败:Landroid/graphics/BlendModeColorFilter;
- java - 如何为方法在接口内部声明并且该接口由两个不同的类实现的方法实现番石榴缓存
- rhel - systemctl 启动服务在 SPEC 文件中不起作用
- javascript - 随着范围滑块的移动计算并显示总数
- javascript - 有没有办法让文本隐藏在输入框中?
- google-app-engine - 如何在 App Engine 标准上部署 gRPC?
- php - 如何在 .htaccess 中使用一行代码隐藏 php 扩展
- c++ - c ++删除存储在向量中的链表的多个头/尾