简体   繁体   English

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

[英]Ember CLI: index.php instead of index.html

I'd like to use an index.php file instead of index.html in my ember application. 我想在我的ember应用程序中使用index.php文件而不是index.html。

I found out that I can set the following in my ember-cli-build.js file, which will output my index.html as index.php 我发现我可以在我的ember-cli-build.js文件中设置以下内容,该文件将我的index.html输出为index.php

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

But with this, the input file still has to be named index.html. 但有了这个,输入文件仍然必须命名为index.html。

Does anybody know how to configure the app in order to have the source file named index.php, too. 有没有人知道如何配置应用程序,以便将源文件命名为index.php。

I couldn't find a way to rename the source file but I had no problems adding php to the index.html file and having it copied over to index.php on build. 我找不到重命名源文件的方法但是我没有问题将php添加到index.html文件并将其复制到构建时的index.php。

I did run into a problem though where after making this change the md5 fingerprints were no longer updated. 虽然在进行此更改后md5指纹不再更新,但确实遇到了问题。

I found the solution here https://github.com/ember-cli/ember-cli/issues/5658 Adapted from the last post: 我在这里找到了解决方案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',
        }
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM