Re: [fw-general] Alternative to Zend_Form
Hey Luiz, There is already a Zend_Form implementation in the laboratory, and since Zend_Form has reached a "ready for review" proposal state now, you can be pretty sure that there should not be any major BC breaks from now on. I, as a fact, already use it and find it very handy ;) Regards Tobias [EMAIL PROTECTED] schrieb: Hello, I'm going to start developing a new application and since Zend_Form isn't ready yet, I would like to know what do you suggest me to use instead. Should I write my own Zend_Form (my own form validation code) or do you think there is something good that I could use? Thank you, Luiz
[fw-general] Alternative to Zend_Form
Hello, I'm going to start developing a new application and since Zend_Form isn't ready yet, I would like to know what do you suggest me to use instead. Should I write my own Zend_Form (my own form validation code) or do you think there is something good that I could use? Thank you, Luiz
Re: [fw-general] Using ZVE Helpers with partial & action helper...
I'm attaching two patches that worked for me, and that should possibly be considered for applying to SVN. On Dec 21, 2007 1:35 PM, Jordan Moore <[EMAIL PROTECTED]> wrote: > I've run into the same issue. It's because the action view helper only > shares view helpers one direction. If the view script requested by the > action helper instantiates a view helper for the first time, that view > helper is not added the original view. I've spent a little bit of time > already trying to figure out how to share them. It involves adding a > method or two to Zend_View_Abstract. I'll post a patch if/when I find > a "fix". > > On Dec 20, 2007 5:05 AM, Eric Coleman <[EMAIL PROTECTED]> wrote: > > > Sorry about sending this to general... either gmail ate my message to > > fw-db or it was denied :/ > > > > ... > > > > Any Placeholder data appears to get lost when using a combination of > > the action helper & partial... > > > > I have something along the lines of: > > > > edit.phtml: > > > > action('action', 'controller') ?> > > > > action.phtml: > > > > partial('_bar.phtml', $data) ?> > > > > If I use any of the head() helpers inside of _bar.phtml, they won't > > get appended into the layout. I'm not sure if this is a bug per-say; > > I could just be doing this in a retarded fashion. > > > > Regards, > > Eric > > > > > > > -- > Jordan Moore - Creative Director > Sanctus Studios LLC > PO Box 2202 > Tacoma, WA 98401 > (253) 238-8676 > -- Jordan Moore - Creative Director Sanctus Studios LLC PO Box 2202 Tacoma, WA 98401 (253) 238-8676 Index: /home/jordan/workspace/zend-framework/library/Zend/View/Abstract.php === --- /home/jordan/workspace/zend-framework/library/Zend/View/Abstract.php (revision 7224) +++ /home/jordan/workspace/zend-framework/library/Zend/View/Abstract.php (working copy) @@ -513,6 +513,37 @@ } /** + * Adds an already instantiated helper. + * + * @param object $helper + * + * @return Zend_View_Abstract + */ +public function addHelper($helper) +{ +if (!is_object($helper)) { +require_once 'Zend/View/Exception.php'; +throw new Zend_View_Exception(__METHOD__ . ' expects an object'); +} + +$class = get_class($helper); +$name = ucfirst(substr($class, strrpos($class, '_') + 1)); + +if (!isset($this->_helper[$name])) { +$this->_helper[$name] = $helper; +$class = new ReflectionClass($class); + +$this->_setHelperClass($name, $class->getName(), $class->getFileName()); + +if (method_exists($helper, 'setView')) { +$helper->setView($this); +} +} + +return $this; +} + +/** * Adds to the stack of filter paths in LIFO order. * * @param string|array The directory (-ies) to add. Index: /home/jordan/workspace/zend-framework/library/Zend/View/Helper/Action.php === --- /home/jordan/workspace/zend-framework/library/Zend/View/Helper/Action.php (revision 7224) +++ /home/jordan/workspace/zend-framework/library/Zend/View/Helper/Action.php (working copy) @@ -125,7 +125,13 @@ // clone the view object to prevent over-writing of view variables $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $viewRenderer->view = $this->cloneView(); - + +foreach ($this->view->getHelpers() as $helper) { +if (method_exists($helper, 'setView')) { +$helper->setView($viewRenderer->view); +} +} + $this->request->setParams($params) ->setModuleName($module) ->setControllerName($controller) @@ -133,6 +139,14 @@ ->setDispatched(true); $this->dispatcher->dispatch($this->request, $this->response); + +foreach ($viewRenderer->view->getHelpers() as $helper) { +$this->view->addHelper($helper); + +if (method_exists($helper, 'setView')) { +$helper->setView($this->view); +} +} // reset the view object to it's original state $viewRenderer->view = $this->view;
Re: [fw-general] Using ZVE Helpers with partial & action helper...
I've run into the same issue. It's because the action view helper only shares view helpers one direction. If the view script requested by the action helper instantiates a view helper for the first time, that view helper is not added the original view. I've spent a little bit of time already trying to figure out how to share them. It involves adding a method or two to Zend_View_Abstract. I'll post a patch if/when I find a "fix". On Dec 20, 2007 5:05 AM, Eric Coleman <[EMAIL PROTECTED]> wrote: > Sorry about sending this to general... either gmail ate my message to > fw-db or it was denied :/ > > ... > > Any Placeholder data appears to get lost when using a combination of > the action helper & partial... > > I have something along the lines of: > > edit.phtml: > > action('action', 'controller') ?> > > action.phtml: > > partial('_bar.phtml', $data) ?> > > If I use any of the head() helpers inside of _bar.phtml, they won't > get appended into the layout. I'm not sure if this is a bug per-say; > I could just be doing this in a retarded fashion. > > Regards, > Eric > -- Jordan Moore - Creative Director Sanctus Studios LLC PO Box 2202 Tacoma, WA 98401 (253) 238-8676
Re: [fw-general] Using ZVE Helpers with partial & action helper...
I've run into the same issue. It's because the action view helper only shares view helpers one direction. If the view script requested by the action helper instantiates a view helper for the first time, that view helper is not added the original view. I've spent a little bit of time already trying to figure out how to share them. It involves adding a method or two to Zend_View_Abstract. I'll post a patch if/when I find a "fix". On Dec 20, 2007 5:05 AM, Eric Coleman <[EMAIL PROTECTED]> wrote: > Sorry about sending this to general... either gmail ate my message to > fw-db or it was denied :/ > > ... > > Any Placeholder data appears to get lost when using a combination of > the action helper & partial... > > I have something along the lines of: > > edit.phtml: > > action('action', 'controller') ?> > > action.phtml: > > partial('_bar.phtml', $data) ?> > > If I use any of the head() helpers inside of _bar.phtml, they won't > get appended into the layout. I'm not sure if this is a bug per-say; > I could just be doing this in a retarded fashion. > > Regards, > Eric > -- Jordan Moore - Creative Director Sanctus Studios LLC PO Box 2202 Tacoma, WA 98401 (253) 238-8676
[fw-general] How to reload a page after form has been submitted
I have created a html form in in Zend Framework application after I submit the form to the Server. My current page will be replaced by a new page or it will be reloaded using the updated page contents depends on the form action. However my current page can not be reloaded with the updated contents. Is there any ways to reload current page after the form have been submitted? -- View this message in context: http://www.nabble.com/How-to-reload-a-page-after-form-has-been-submitted-tp14459193s16154p14459193.html Sent from the Zend Framework mailing list archive at Nabble.com.