Jump to content


Photo

ZF 1.12 Controller runs after the view, the forms are not getting created

zend framework

  • Please log in to reply
3 replies to this topic

#1 yoursurrogategod

yoursurrogategod

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts

Posted 11 January 2013 - 03:53 PM

Here are my files.

The view:
http://bin.cakephp.org/view/542541964

The controller:
http://bin.cakephp.org/view/132354357

The form:
http://bin.cakephp.org/view/40623455

Now, when I run this, this is the text that I see:

entering view
asdfasfasd
exiting view
ENTER - buildAffiliateSelectForm - Application_Form_Input
EXIT - buildAffiliateSelectForm - Application_Form_Input

Why is my controller (action, in this case) is executing after the view? This doesn't make any sense.

#2 trq

trq

    Advanced Member

  • Administrators
  • 30,723 posts
  • LocationSydney, Australia.

Posted 11 January 2013 - 09:18 PM

It's not executing afterward, but is displaying afterward. The view layer uses various pieces of buffer trickery to do it's job. Hence, output outside of a view is not recommended. What exactly is the issue you are trying to solve?

http://thorpesystems.com | http://proemframework.org | http://github.com/trq

SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
OPM - My Linux package manager.


#3 yoursurrogategod

yoursurrogategod

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts

Posted 14 January 2013 - 10:15 AM

It's not executing afterward, but is displaying afterward. The view layer uses various pieces of buffer trickery to do it's job. Hence, output outside of a view is not recommended. What exactly is the issue you are trying to solve?

Basically, what I'm trying to do is have the form elements (Zend_Form_Element_Select, for example) to show up in my view. This used to work (I swear), but suddenly they stopped working. And I don't know why. In the example above, I should see a drop down (even if it's not populated at all and has only 1 item in it).

[edit]

Fixed the size of the text.

Edited by yoursurrogategod, 14 January 2013 - 10:16 AM.


#4 yoursurrogategod

yoursurrogategod

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts

Posted 15 January 2013 - 10:14 AM

Ok, putting a parent::__construct($options); in the constructor did it. $options were set by default to null.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com