我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

从Twig获取JSON数组数据

I need to pass an array passed in Twig as a parameter for a javascript object.

        $app->render("site/home.twig.html", array(
        "page" => "home",
        "trans" => $translationfile
    ));

$translationfile is a value generated from json_decode'ing a JSON file containing translation values.

When I attempt to access the part of the file I want to access;

var translations = "{{ trans.production }}";

I get "Array" as an answer.

I assume there's a way to obtain the array? Do I need to encode it?

近期文章

  • 使用codeigniter的分页问题
  • PHP 5.4:日期格式之间的转换[重复]
  • 来自外部来源的电子邮件附件不起作用
  • 列出文件夹中缺少图片的名称
  • Chef Cookbook安装5.5包或源码
  • Wordpress联系表格7 Datepicker重新加载页面
  • 返回第三方网站后网站是否返回发布数据
  • PHP:1个表单中的2个发布方法导致覆盖先前显示的数据
  • AngularJS服务返回Laravel Blade模板
  • Laravel Cache。 如果值不存在则递增或放置
  • 无法检查MySQL查询是否返回任何内容
  • 知道access_token是用于应用程序文件夹还是完全访问?
  • 无论顺序如何,检查关联的多维数组是否相等
  • Angular Js与mysql php
  • 在PHP MYSQL中将多个文件插入/上载到数据库表中的特定行
  • 在没有sql的记录结果中搜索%LIKE%
  • Symfony2主机匹配的路由也匹配其他路由
  • Fullcalendar wordpress提交预订
  • 使用codeigniter分页
  • 如何在php mysql中使用mvc框架创建表单?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华