Re: Explain the empty function
http://php.net/manual/de/function.empty.php On 7 Jan., 19:56, zer0_gravity wrote: > I did this because I wanted to understand if the empty() is checking > for a null contained $this->data. > > On Jan 7, 12:57 pm, Miles J wrote: > > > > > > > > > Why are you attempting to do that? > > > !empty() checks to make sure the POST data exists, empty() checks to > > make sure the POST data is empty. > > > On Jan 7, 9:10 am, zer0_gravity wrote: > > > > function add(){ > > > if(!empty($this->data)){ ///why does this statement works > > > /// if(empty($this->data)){ why does this statement > > > do nothing > > > if($this->Post->save($this->data)){ > > > $this->Session->setFlash('Your post has been saved.'); > > > $this->redirect(array('action' => 'index')); > > > } > > > > } > > > } Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Explain the empty function
I did this because I wanted to understand if the empty() is checking for a null contained $this->data. On Jan 7, 12:57 pm, Miles J wrote: > Why are you attempting to do that? > > !empty() checks to make sure the POST data exists, empty() checks to > make sure the POST data is empty. > > On Jan 7, 9:10 am, zer0_gravity wrote: > > > > > function add(){ > > if(!empty($this->data)){ ///why does this statement works > > /// if(empty($this->data)){ why does this statement > > do nothing > > if($this->Post->save($this->data)){ > > $this->Session->setFlash('Your post has been saved.'); > > $this->redirect(array('action' => 'index')); > > } > > > } > > } Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Explain the empty function
Why are you attempting to do that? !empty() checks to make sure the POST data exists, empty() checks to make sure the POST data is empty. On Jan 7, 9:10 am, zer0_gravity wrote: > function add(){ > if(!empty($this->data)){ ///why does this statement works > /// if(empty($this->data)){ why does this statement > do nothing > if($this->Post->save($this->data)){ > $this->Session->setFlash('Your post has been saved.'); > $this->redirect(array('action' => 'index')); > } > > } > } Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Explain the empty function
function add(){ if(!empty($this->data)){ ///why does this statement works /// if(empty($this->data)){ why does this statement do nothing if($this->Post->save($this->data)){ $this->Session->setFlash('Your post has been saved.'); $this->redirect(array('action' => 'index')); } } } Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en