1

Folks, I'm having some problems making a form render/display in my webpage. Well, it works fine in my local server, but once I use the same code in a remote server, the webpage displays fine, but the form is missing.

Localhost:
OS: Win 7
PHP: 5.3.8
Apache: 2.2.21
Zend: 1.11.3

Remote Server:
OS: Linux CentOS release 5.5
PHP: 5.3.8
Apache: 2.2.3
Zend: 1.11.3

FeedbackForm.php

class forms_FeedbackForm extends Zend_Form {

public function init() {

$this->setAction('')->setMethod('post')->setName('feedbackForm');

$feedback = new Zend_Form_Element_Textarea('feedback');

$submit = new Zend_Form_Element_Button('submitButton');

$this->addElement($feedback)->addElement($submit);
} }

IndexController.php

class IndexController extends Zend_Controller_Action {

public function indexAction() {

$form = new forms_FeedbackForm();

 $this->view->form = $form; 

} }

index.phtml

echo $this->form;



However, if I replace the echo statement with print_r($this->form), I see the object details with both servers.

3 Answers 3

1

Use a capital for your class: Forms_FeedbackForm instead of forms_FeedbackForm. The autoloader doesn't find it on Linux.

Generally when problems like this occure between Linux and Windows servers it's a capital problem. Linux is case sensitive, windows isn't.

Sign up to request clarification or add additional context in comments.

Comments

0

Your code looks fine. I suggest you set display exceptions on in your application.ini:

resources.frontController.params.displayExceptions = 1 And make sure your error view displays exceptions.

9 Comments

Thanks for the advise, but that didn't do anything either. Still no form!
I can see the form object details if I do a print_r() instead of echo
what do you see when you do: echo $this->form->render(); ?
Same. Still so form on Linux, and the localhost still works fine.
Btw, just did a diff on the form objects outputted with print_r() and they are exactly the same.
|
0

Make sure that your view looks like <?php echo $this->form; ?>, otherwise, the PHP won't actually execute.

1 Comment

I do have the php tags on there, just forgot to add them above.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.