Issue Type: Bug Created: 2008-01-31T07:58:49.000+0000 Last Updated: 2008-03-25T11:19:45.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)
Reporter: Matthew Weier O'Phinney (matthew) Assignee: Ralph Schindler (ralph) Tags: - Zend_Controller
Related issues: Attachments:
A regression in the ViewRenderer was reported on the fw-general list. The following code:
<pre class="highlight"> // from a controller action: $this->render('layout/admin', null, true);
results in the exception "script 'layout-admin.phtml' not found in path'.
In this particular case, the user has specified a view script in a subdirectory -- and the Inflector is replacing the directory separator with a dash. Directory separators should be preserved.
Posted by Ralph Schindler (ralph) on 2008-02-14T12:03:31.000+0000
Please confirm r8000 fixes this issue.
Inflector altered to include DIRECTORY_SEPARATOR and test added to support such use case.
Posted by Miroslav Kubelik (koubel) on 2008-02-15T06:15:05.000+0000
Maybe this issue hangs together with the ZF-2538
Posted by Matthew Weier O'Phinney (matthew) on 2008-02-15T06:35:38.000+0000
Miroslav -- no, ZF-2538 is a very different issue. This particular issue has to do with the specific inflection rules relating to the ':action' target, which did not account for directory separators at all; in the previous released versions, there was no such limitation, which is why this is termed a regression.
Posted by Matthew Weier O'Phinney (matthew) on 2008-02-15T12:46:58.000+0000
I can verify that the fix in trunk resolves the issue.
Posted by Ralph Schindler (ralph) on 2008-02-15T12:51:57.000+0000
Sweet sweet, closing issue, Yay.
Posted by Miroslav Kubelik (koubel) on 2008-02-18T05:49:14.000+0000
Yes Raplh, you are right, thank you for your work.
Posted by Bart McLeod (email@example.com) on 2008-03-24T17:32:08.000+0000
I was looking for a similar issue, in order to know if I should report it or not. It looks like this one, so I will start with a comment here and possibly post the issue later on if it is not allready there. My issue refers to the examples of rendering views from within an action controller while using the MVC. The examples can be found in section 7.7 of the programmers reference guide. I am working in the release version 1.5 of ZF.
Trying these examples from section 7.7 $this->view->render('save'); // does not render /my/save.phtml, instead raises error, scirpt 'save' not found etc. $this->view->render('save.phtml'); //does not render /my/save.phtml, instead raises same error, is looking for 'save.phtml' in scripts directory instead of 'scirpts/my' directory $this->view->render('my/save.phtml'); //does not raise an error, but displays nothing. Echo $this->view->render() etc. does, but I find it strange to echo it inside the controller. I would expect to call echo inside the view.
It is possible that the documented behavior changed over time. Then it is time to update the reference guide to reflect this.
Posted by Ralph Schindler (ralph) on 2008-03-25T11:19:45.000+0000
I am not following completely.
Chapter 7.7 of the manual (found here: http://framework.zend.com/manual/en/) is on the Action Helpers.
Specifically, you'd want to be using the viewRenderer action helper. To do that, your examples above (which i cannot seem to find in the manual), would need to be without the direct call to view. $this->render(..) from inside an action controller will proxy to the ViewRenderer.
This is what you should try:
<pre class="highlight"> $this->render('save'); $this->render('save.phtml'); $this->render('my/save.phtml');
Have you found an issue?
See the Overview section for more details.