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
2 answers

How to render a view from another module outsidethe view folder in Zend Framework 2?

I want to bundle the whole error handling in one module. It's working so far, but the error template is still the default [project root]/module/Application/view/error/index.phtml. I want to use it, but wrapped by my additional code. For this I need…
automatix
  • 14,018
  • 26
  • 105
  • 230
0
votes
2 answers

Zend Framework: How to make view from bootstrap.php

For example i have echo $this->escape($this->test); in index.phtml and in controller $this->view->test = 'test message';, but i want to do this from bootstrap, becouse i want to show Form in every page (controller).
0
votes
1 answer

zend get posted variables from static form from the view file

Ok so i tried using zend form but what i'm trying to accomplish is way too much for me to handle zend form. I'll try to describe it in a few lines maybe you have a solution for me if not you will understand why i chose to use a form in a view…
user253530
  • 2,583
  • 13
  • 44
  • 61
0
votes
1 answer

How to check for invalid route in layout view

I have this piece of code written in Application/view/layout/layout.phtml for adding a link which will be pointing to current page. This I added for debugging purpose for refreshing the current page.
  • dejjub-AIS
    • 1,501
    • 2
    • 24
    • 50
  • 0
    votes
    1 answer

    Can't set view variables from postDispatch() in Zend Framework

    We have a plugin which has a postDispatch hook used to record usage statistics on a CMS developed using ZF1. After one of the records is generated, we need to get it's unique id to the view to be able to update it via AJAX requests. Several posts…
    Lando
    • 715
    • 6
    • 29
    0
    votes
    1 answer

    How we should use zend view helper form with validators + filters?

    How we should use zend view helper form with validators + filters? Example that miss validators + filters from: http://framework.zend.com/manual/en/zend.view.helpers.html

    Ben
    • 25,389
    • 34
    • 109
    • 165
    0
    votes
    1 answer

    Using Zend partialLoop Viewhelper with an object

    I wanted to learn a bit more about view helpers, epecially partialLoop helpers. I tried with the following code snippets, but it does't work. I built a partialLoop helper:
    pia-sophie
    • 505
    • 4
    • 21
    0
    votes
    1 answer

    Zend 1 to Zend 2, was using decorators, how can i achieve the same behavior now?

    The title of the question is not self-explanatory, as there are tons of questions about migrating a Zend 1 app to a Zend 2 one, so i'll cut to the specifics of my problem. First and foremost we used decorators to our form elements inside our view…
    MurifoX
    • 14,991
    • 3
    • 36
    • 60
    0
    votes
    3 answers

    Overwrite zend view directory?

    In my bootstrap, I detect the site the users on, then issue the layout change and helper change. Essentially anything that is there by default is what the site falls back on if there is no per site version in /public/site/ However I cannot get the…
    azz0r
    • 3,283
    • 7
    • 42
    • 85
    0
    votes
    2 answers

    How to call a view from a view in Zend Framework?

    I need to render a view from inside a view. For the sake of question, i'll call them blocks. I have 5 controllers, each of them has an action that is called BlockAction(), and it displays some of the information from that controller. In the Index…
    Janis Peisenieks
    • 4,938
    • 10
    • 55
    • 85
    0
    votes
    1 answer

    How To Use toRoute in ZF2 View Helper

    I want to use toRoute or redirect controller plugin in my view helper. I know View helpers extend functionality on the view layer and are for reusability throughout our application. Controller plugins extend functionality on the controller layer.…
    Manish Jangir
    • 5,329
    • 4
    • 42
    • 75
    0
    votes
    2 answers

    How to include multiple action&controller in Zend Framework 2

    I would like to include multiple views within a view in ZF2. I read this link: http://framework.zend.com/manual/current/en/modules/zend.view.quick-start.html but there is a problem. In this way, I have to pass the values that are within a view, like…
    0
    votes
    1 answer

    ZF2 dissable layout in view templates (phtml files)

    i was trying to dissable layout in my override of zfc user login page here is what i tried so far : $this->viewmodel()->getCurrent()->setTerminal(true); $this->viewmodel()->getRoot()->setTerminal(true);
    Sina Miandashti
    • 2,087
    • 1
    • 26
    • 40
    0
    votes
    2 answers

    How to pass parameter from View Helper (widget) to action?

    I have widget which is calling an action for another controller and I need to pass a parameter to the action. I tried the following so far and I am getting the following error : Error Fatal error: Call to a member function getParam() on a non-object…
    vlr
    • 780
    • 4
    • 16
    • 33
    0
    votes
    1 answer

    How can I output child view with dynamically generated captureTo for addChild() in controller

    Giving the following manual: enter link description here It is quite easy to have a child view and echo it when I know captureTo used in the controller (e.g. "article ?>"), but can I do similar when I generate view models…
    vlr
    • 780
    • 4
    • 16
    • 33