I use typical function:

function add()
       {
               if (empty($this->params['data']))
               {
                       $this->render();
               }
               else
               {
                       if ($this->Post->save($this->params['data']))
                       {
                               $this->flash('Your post has been
saved.','/posts');
                       }
                       else
                       {
                               $this->set('data', $this-
>params['data']);
                               $this->render();
                       }
               }
       }

Interesting: one host, 4 copy of code (different folders, DB). But in
one copy does'nt work validation.
When I type: /posts/add I see message: "Post was added" and get empty
record in table.
In model post.php, of couse, I wrote: body, title VALID_NOT_EMPTY.
Very strange: 3 copy worked normal. One - have problem. Why - I don't
understand ;-(

I add if ($ this->params['data']['Post']['body'] != '')... And code
work properly.

But why? I don't understand ;-(

Version:  1.1.15.5144


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to