Questions tagged [zend-view]

provides the “View” layer of Zend Framework 2’s MVC system. It is a multi-tiered system allowing a variety of mechanisms for extension, substitution, and more.

The components of the view layer are as follows:

  • Variables Containers hold variables and callbacks that you wish to represent in the view. Often-times, a Variables Container will also provide mechanisms for context-specific escaping of variables and more.
  • View Models hold Variables Containers, specify the template to use (if any), and optionally provide rendering options (more on that below). View Models may be nested in order to represent complex structures.
  • Renderers take View Models and provide a representation of them to return. Zend Framework 2 ships with three renderers by default: a PhpRenderer which utilizes PHP templates in order to generate markup, a JsonRenderer, and a FeedRenderer for generating RSS and Atom feeds.
  • Resolvers utilizes Resolver Strategies to resolve a template name to a resource a Renderer may consume. As an example, a Resolver may take the name “blog/entry” and resolve it to a PHP view script.
  • The View consists of strategies that map the current Request to a Renderer, and strategies for injecting the result of rendering to the Response.
  • Rendering Strategies listen to the “renderer” event of the View and decide which Renderer should be selected based on the Request or other criteria.
  • Response Strategies are used to inject the Response object with the results of rendering. That may also include taking actions such as setting Content-Type headers.
290 questions
0
votes
1 answer

passing two tableadaptercolletions to view

I'm still trying to get as "hierarchical" view the recordssets of a second tableadapter collection. In my controlleraction I passed a second argument to the view: return new ViewModel([ 'projects' => $this->projectTable->fetchAll(), …
pia-sophie
  • 505
  • 4
  • 21
0
votes
0 answers

pass a keyvalue to my innerloop

In my view I want to show 2 recordsets, like this:
pia-sophie
  • 505
  • 4
  • 21
0
votes
2 answers

edit action similar to tutorial doesn't work

I followed the ZF3 tutorial and I'm quite satisfied, but I'm something missing with the edit action in my controller. the add action works fine while the edit action doesn't. Probably I don't see it by myself, so I post it here, asking for help,…
pia-sophie
  • 505
  • 4
  • 21
0
votes
2 answers

How to access services from a view script in Zend Framework 3?

I have a custom authentication service and in ZF2 I accessed this as follows: Application/view/layout/layout.phtml $authenticationService = $this->getHelperPluginManager() ->getServiceLocator() …
0
votes
0 answers

passing data to nested views

I tried first time with nested views in zend3. My templates will be loaded but no data appears, instead of that I get an error. Here what I tried: controller/index $view = new ViewModel(); $projectView = new ViewModel(['project' =>…
pia-sophie
  • 505
  • 4
  • 21
0
votes
1 answer

how can partialLoop viewhelper be used in zend3 with tablegateway

I still have trouble to get used to Zend3 framework. Before I have used Zend 1, it might be still an understanding problem due to tablegatewayadapter. I just want to show 2 entities together, which would be projects 1-n units.So I have to pass the…
pia-sophie
  • 505
  • 4
  • 21
0
votes
1 answer

Zend passing data from action in controller to view in another controler

How can I pass data from action in controller to view in another controller? From action in controler to view in the same controller is easy: I simply write in action's function : $this->view->assign('error', 'Wrong login'); and in view I recieve…
Bukocen
  • 51
  • 1
  • 1
  • 4
0
votes
1 answer

Zend: How to append unique