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

Render view with children

I have a problem with render a view inside action. Here is my code: public function editUserAction() { $sideView = new SideViewModel(); $sideView->setHeaderView(new HeaderViewModel(array( "title" => 'Editing user', "desc" => 'Edit your…
bordeux
  • 612
  • 1
  • 8
  • 23
0
votes
1 answer

PHP syntax: Zend Framework view script dilemma

So I want to use a jQuery tab container in my view script. I have tested it so I know I already have everything working. tabContainer()->addPane('container-name', 'label', 'content goes here'); ?>
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
1 answer

ZF2: How to catch exceptions thrown by a view helper automatically

I have a some view helpers throwing exceptions on error. That's ok for development, but for production I would like to configure PhpRenderer to catch and log the exception without braking the hole view file to render - simply return nothing. The…
mabe.berlin
  • 1,043
  • 7
  • 22
0
votes
2 answers

Is it a bug for Zend Framework's Zend_View?

View Helpers have some initial helpers, such as formButton and formText. As the reference said: formText($name, $value, $attribs): Creates an element. But I find something not like it on my PC. I write below code in a view…
roast_soul
  • 3,554
  • 7
  • 36
  • 73
0
votes
2 answers

Zend View : How to use an output multiple times in the same view script?

I'm working on a page which show a list of articles of a catalog, with a pagination (I don't use Zend_Paginator) The pagination bloc is ok, but I would render it multiple times (at the top and at the bottom of the list) Inside the view script, is…
Alexandre Brach
  • 325
  • 2
  • 12
0
votes
1 answer

Zend Framework 2 actions without layout by default

I would like set all actions because when these return a ViewModel class, this has the parameter setTerminal = true by default. I want that my aplication have this behavior because the 90% of my calls are AJAX. Thanks in advance.
josepmra
  • 617
  • 9
  • 25
0
votes
0 answers

How to bootstrap Zend view just from application.ini?

I'm using Zend Framework 1.12 and I would like to bootstrap my view in the application.ini only. Current setup: resources.view[] = "" resources.view.encoding = "UTF-8" resources.view.basePath = APPLICATION_PATH "/views/" resources.view.doctype =…
Ivan
  • 315
  • 1
  • 3
  • 16
0
votes
1 answer

Zend Paginator can't find view file

I have extended the Zend paginator so I can use it in my own service layer. The issue is getting it to display in my view. (My admin page is not in a view/script folder but in a some legacy code in public - don't ask lol). I have got an instance of…
Kal
  • 2,239
  • 6
  • 36
  • 74
0
votes
3 answers

How to make variable that can be used in many views?

I have a project, it has a structure like this: http://img526.imageshack.us/img526/2333/92348689.png I want to make a variable like the following $templatePath = $this->baseUrl('/application/templates/')` and it can be used in many views, in many…
Killer Whale
  • 87
  • 2
  • 12
0
votes
1 answer

Zend Framework 2, MVC pattern and View Helpers disussion

What's sence have use view Helpers which they can see business logic if the goal of the MVC pattern is separate the view of the business logic? When I use the View Helper, it breaks the separation between both terms, does this mean that the view…
0
votes
2 answers

Zend Framework - Controller - HeadScript - Not Loading After `composer update`

I am quite new to Zend Framework (2). I have been developing a mini ERP as a project and every thing seemed to be good. But this morning, I wanted to install PHPUnit, I updated the composer.json file and ran composer install but it saind nothing to…
Ziyan Junaideen
  • 3,270
  • 7
  • 46
  • 71
0
votes
1 answer

getView() returns NULL in zend framework 2 Custom Form View Helper

Trying to get the view object from a view helper so I can render a certain partial. but All I get is NULL here is the code namespace App\Form\View\Helper; use Zend\Form\View\Helper\AbstractHelper; use Zend\Form\View\Helper\FormInput; use…
Omar
  • 8,374
  • 8
  • 39
  • 50
0
votes
1 answer

Zend Framework 2 inherid variables from parent view

I have the following code which returns a view with a subview. As it can see, the subview repeats the variable $form and the array &fields duplicating the pass of variables into view. How I can inherit to userProfileInformationView these variables…
josepmra
  • 617
  • 9
  • 25
0
votes
3 answers

Zend: Custom View helpers

I'm trying to add a View helper in my project, but I'm getting the following error: [Mon Apr 29 14:36:19 2013] [error] [client 10.0.0.26] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name…
Corné Guijt
  • 122
  • 1
  • 11
0
votes
1 answer

Zend Framework 2 - Annotation forms - Multiple forms in one view

I'm using ZF2 and AnnotationForms. This worked great for me until now. I have this exception that I want to display three forms in one view. Basically I do the following:
Ron
  • 22,128
  • 31
  • 108
  • 206