Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个安装在我的 Rails(3.2.8) 路由器中的第 3 方 Sinatra(1.3.3) 应用程序。但我想覆盖页面模板,使其看起来与其他部分一致。如何让 Sinatra 在我的 Railsapp/views目录中查找模板?
app/views
在您的 Sinatra 应用程序中定义以下内容:
set :views, '/path/to/rails/views'
如果它不是您的应用程序,也许您可以使用继承。
class MyApp < ThirdPartyApp configure do set :views, '/path/to/rails/views' # Override end end
路线:
mount MyApp.new, at: '/my_app'
我知道这可能是一个菜鸟问题,但我真的无法弄清楚。
我被要求修改现有的 php 代码,所以我下载了代码并尝试在我的机器上运行,但我无法让它工作。
据我了解,我们编写 php 代码
<?php //some code ?>
但是我下载的这段代码使用了这样的php代码