1

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 ??

Simon P Stevens
  • 27,303
  • 5
  • 81
  • 107

1 Answers1

2

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
takeshin
  • 49,108
  • 32
  • 120
  • 164
  • My statement is $this->view->form = $form; and I am getting the following error message.... Strict Standards: Creating default object from empty value in C:\dev\workspaces\adxweb\application\adxsearch\modules\account\controllers\AuthController.php on line 81 – Lakshman Tirlangi Mar 02 '11 at 08:37
  • @lakshman So look at that line and spot the problem. Maybe you have disabled view somehow? – takeshin Mar 02 '11 at 08:44
  • Hmmm....The line holds the following in controller file and it is even displaying the form when I give echo as " echo $this->getView()->form = $form; " but when remove echo and use the following statement "echo $this->form" in login.phtml file, it is not displaying the form design...I am really not getting any clue how to trace this...plz suggest if any alternate way to get the view...ty – Lakshman Tirlangi Mar 02 '11 at 08:49
  • @lakshman use `Zend_Debug::dump($this->view)` before the line and the line before and so on, until you will get the real view object dumped instead of null. – takeshin Mar 02 '11 at 08:54
  • plz see my code...I have edited ur response and added to it...thanks for your help – Lakshman Tirlangi Mar 02 '11 at 09:41
  • The problem is with $this->view...I have tried to display static message by assigning in controller file as "$this->view->pageTitle = "User Registration Form";" and given as "

    pageTitle ;?>

    " in login.phtml and it did not display the message...plz let me know what could be the issue for not getting this displayed...thanx
    – Lakshman Tirlangi Mar 02 '11 at 10:10