在Symfony 2.5中,自定义视图不会覆盖FOSBundle视图

时间:2016-10-11 13:28:50

标签: php symfony composer-php fosuserbundle

我的本​​地环境中的FosBundle视图实现与DEV之间存在一些奇怪的不匹配。两个系统共享完全相同的配置文件和环境变量,并使用相同的分支。一切都被拉上并推动,.gitignore内容是相同的。

Composer.json (两者都相同):

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.5.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "^1.3",
    "symfony/assetic-bundle": "^2.7",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "~2.0@dev",
    "simplesamlphp/simplesamlphp": "^1.14",
    "white-october/pagerfanta-bundle": "~1.0",
    "antimattr/google-bundle": "~2.0@stable",
    "symfony/property-access": "^2.7",
    "leafo/scssphp": "^0.3.2",
    "patchwork/jsqueeze": "~1.0",
    "phpunit/phpunit": "4.8.*",
    "mockery/mockery": "^0.9.4",
    "farmatholin/segment-io-bundle": "dev-master"
},

app / config / parameters.yml (两者都相同,不同的db user / pass):

parameters:
    database_driver: pdo_mysql
    database_host: 127.0.0.1
    database_port: null
    database_name: dbname
    database_user: root
    database_password: 'pass'
    locale: en
    secret: 'bla'
    debug_toolbar: true
    debug_redirects: false
    use_assetic_controller: true
    google_analytics_name: domain_google_analytics
    google_analytics_account_id: bla
    google_analytics_domain: .domain.com
    mailer_port: 587
    mailer_encryption: tls
    mailer_transport: smtp
    mailer_host: email-smtp.host.com
    mailer_user: user
    mailer_password: blabla
    mailer_auth_mode: login
    set_cli_mailer_host: 'http://domain.com'
    set_use_mailer: swiftmailer
    set_internal_mails_only: false
    segment_write_key: 

我还可以提供config.yml内容,但在两种环境下都是相同的。我们已覆盖原始FOSBundle视图以重置密码,注册和其他人,并将新模板放在我们自己的捆绑包中:src/UserBundle/Resources/views/Resetting/checkEmail.html.twig

{% extends "FOSUserBundle::layout.html.twig" %}

{% trans_default_domain 'FOSUserBundle' %}

{% block fos_user_content %}
    <section>.....</section>
{% endblock %}

在DEV环境中,它都按预期工作,但在本地它忽略了被覆盖的模板,只使用/vendor/friendsofsymfony/user-bundle/Resources/views/Resettin/

中的模板

我真的被困住了。尝试过两者:

  • 作曲家自我更新;作曲家更新; composer install;
  • php app / console cache:clear; rm -rf app / cache *
  • 检查服务器是否有一些opcache - none;
  • php app / console assetic:dump

没有任何改变。代码和配置中的一切都是相同的,但它们加载了不同的视图。为什么呢?

1 个答案:

答案 0 :(得分:2)

如果您最近更新过,则checkEmail.html.twig模板已重命名为check_email.html.twig

查看当前模板: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/views/Resetting/check_email.html.twig