php - Ember CLI : index. php 而不是 index.html

标签 php ember.js ember-cli

我想在我的 ember 应用程序中使用 index.php 文件而不是 index.html。

我发现我可以在我的 ember-cli-build.js 文件中设置以下内容,这会将我的 index.html 输出为 index.php

outputPaths: {
      app: {
        html: 'index.php'
      }
    }

但是有了这个,输入文件仍然必须命名为 index.html。

有谁知道如何配置该应用程序,以便将源文件也命名为 index.php。

最佳答案

我找不到重命名源文件的方法,但在将 php 添加到 index.html 文件并在构建时将其复制到 index.php 时我没有遇到任何问题。

我确实遇到了一个问题,虽然在进行此更改后 md5 指纹不再更新。

我在这里找到了解决方案 https://github.com/ember-cli/ember-cli/issues/5658 改编自上一篇文章:

// in ember-cli-build.js
var app = new EmberApp(defaults, {
    // Add options here
    fingerprint : {
        replaceExtensions : [ 'html', "php", 'css', 'js' ]
    },
    outputPaths : {
        app : {
            html : 'index.php',
        }
    }
});

关于php - Ember CLI : index. php 而不是 index.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33477813/

相关文章:

php - 在 WooCommerce 文件中的产品行之间添加内容

javascript - 找不到从`AppName/resolver Ember 测试中导入的模块 `ember-resolver`

javascript - 让 JsonApiAdapter.js 与 Ember CLI 配合使用

typescript - 扩展 angular-cli 的构建管道

java - 如何将值从java传递给PHP?

javascript - 尝试制作一个按钮,仅显示设置了值或变量的项目

ember.js - 如何通过 ES6 模块使用 Socket.IO 客户端?

ember.js - 为什么使用 itemController 会呈现空项目的集合?

ember.js - Ember CLI - "Could not find watchman, falling back to NodeWatcher for file system events installing"

php - composer update 给出关于私有(private)存储库元数据的 404