Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using ZfcTwig brakes ViewJsonStrategy when registered at first #34

Closed
romankonz opened this issue Nov 18, 2012 · 5 comments
Closed

using ZfcTwig brakes ViewJsonStrategy when registered at first #34

romankonz opened this issue Nov 18, 2012 · 5 comments

Comments

@romankonz
Copy link

In my application, the ViewJsonStrategy is registered and used in "MyModule".

If i add "ZfcTwig" before "MyModule" in the application.config.php, the ViewJsonStrategy won't work:

  • if i use the "Accept: application/json" Header to "force" json rendering
  • and also if i return a JsonModel directly in my Controller/Action

If i add ZfcTwig after adding "MyModule", everything works fine.

application.config.php before - this will brake the ViewJsonStrategy:

<?php
return [
   'modules' => [
        'ZfcTwig',
        'MyModule',
    ],
];

this will fix the ViewJsonStrategy:

 <?php
 return [
    'modules' => [
         'MyModule',
         'ZfcTwig',
     ],
 ];

As far as i know, it happens because it's added at the same priority, so it is tested for the ability to render in the order it is added.

I think - at least - it's worth adding this to the Readme.md.

@spiffyjr
Copy link
Contributor

Does this still happen in the refactor branch?

@rmasters
Copy link
Contributor

Also having this issue with a simple return new JsonModel([...]); in the controller, but the good news is it doesn't happen in refactor (at f5b116b).

@Saeven
Copy link
Contributor

Saeven commented Mar 25, 2014

Still experiencing this, ZF 2.2.6, ZfcTwig 1.1.5

@exaunique
Copy link

issue resolved

@kusmierz
Copy link

see #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants