View Single Post
  #1 (permalink)  
Old 07-11-2008, 11:04 AM
jjshell jjshell is offline
Junior Member
 
Join Date: Dec 2007
Posts: 6
Default [ZF] renders twice the view script....?

Hi,

I'm playing with the ZF. When I render a view, it gets rendered twice....

Here is my controller script:

PHP Code:
<?php

class TestController extends Zend_Controller_Action
{


  function 
testViewAction()
  {
  
    
$view = new Zend_View();
    
$view->assign('a'"Hay");
    
$view->assign('b'"Bee");
    
$view->assign('c'"Sea");
    
    
$view->setScriptPath('application/views/scripts/test/');
    
    
$render $view->render('test-view.phtml');
    
    echo(
$render);
  
  }

}
Here is my view script:
PHP Code:

<ul>
<li><?php echo($this->a); ?></li>
<li><?php echo($this->b); ?></li>
<li><?php echo($this->c); ?></li>
</ul>
Here is the outputed html. As you'll notice, the first rendering doesn't get what is between the php tags...

Code:
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<ul>
<li>Hay</li>
<li>Bee</li>
<li>Sea</li>
</ul>
I've chcked my index/bootstrap, Zend_View isn't instantiated somewhere else...

I'm a bit lost

Regards,

-jj.
Reply With Quote