Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Zend view does not work standalone #3

Closed
cdekok opened this issue Jun 10, 2015 · 3 comments · Fixed by #25
Closed

Zend view does not work standalone #3

cdekok opened this issue Jun 10, 2015 · 3 comments · Fixed by #25
Labels

Comments

@cdekok
Copy link
Contributor

cdekok commented Jun 10, 2015

Or at least is missing required dependencies:

composer require zendframework zend-view
$view = new \Zend\View\Renderer\PhpRenderer();

Fatal error: Class 'Zend\ServiceManager\AbstractPluginManager' not found

The problem runs deeper then just view though now am trying to setup standalone forms and there are some issues with it too.

@gianarb
Copy link
Contributor

gianarb commented Jun 10, 2015

👍 This component suggests zendframework/zend-servicemanager and this package is REQUIRED for your implementations..

Why is suggested and not required? 👎 There are a lot of response about this question..
I have wrote a blogpost about this stuff http://gianarb.it/blog/the-price-of-modularity/ :)

@mech7 you can try to add zendframework\zend-servicemanager in your composer.json.. :)

@mtymek
Copy link
Contributor

mtymek commented Jun 10, 2015

Sometime ago I blogged on how to make it work standalone: http://mateusztymek.pl/blog/using-standalone-zend-view.
It's a bit quirky, but works.

@weierophinney
Copy link
Member

@mech7 Zend\View is not just the PHP renderer. It also provides an event-driven view layer (which allows you to specify your own rendering and response strategies), and interfaces for things such as the renderers themselves. If you are doing JSON views, the JsonRenderer requires no extra dependencies whatsoever.

Our policy has been to only require dependencies that are used by every workflow, and to suggest all other dependencies. (For development purposes, most, if not all, suggested dependencies are required to allow testing.)

Now that the components are split, we'll also be going one step further. If you look at the work done on Zend\Feed, we created an interface for loading feed reader plugins, and a default implementation that specifies all the plugins we ship. When used as part of a full ZF2 application, however, the ServiceManager-based implementation is used instead, allowing for configurable plugins. We'll be doing similarly for the view helpers in this component as well.

However, right now, follow the suggestions shown when you install this component: it suggests that if you are using the PhpRenderer, you need to also install zendframework/zend-servicemanager. So install it.

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

Successfully merging a pull request may close this issue.

4 participants