unable to access zend views from controller file

407 views Asked by At

I am able to print the form content in the controller file, but when I assign the form view as $this->view->form = $form and trying to display the form design using echo $this->form in login.phtml file, form design is not viewed, instead displaying blank page....

What could be the issue ??

1

There are 1 answers

6
takeshin On

Looks like it should work:

// in the controller
$this->view->form = $form;

// in the view
<?= $this->form ?>

So the problem is somewhere else.

The blank page is displayed probably due to that the error_reporting is turrned off.

Update application.ini and set error_reporting, displaying errors and throwing exceptions to true to see what is actually happening.

Edit:

Things to check:

  • Is your view initialized?
  • Does your application.ini contains any resources.view[]=
  • haven't you accidentally overwritten the view? $this->view = null