I got it to work with the suggested code... the problem was just that I spelled the model wrong. I should have named it app/models/post.php but I named it app/models/posts.php, so Cake was just making a model for me without validation. Whoops!
On Jun 24, 10:10 am, eliot1785 <[email protected]> wrote: > Unfortunately, that doesn't work either. > > On Jun 23, 8:04 pm, Miles J <[email protected]> wrote: > > > var $validate = array('title' => 'notEmpty', 'body' => 'notEmpty'); > > > On Jun 23, 3:25 pm, eliot1785 <[email protected]> wrote: > > > > I am going through the blog setup tutorial and although I've just used > > > the code that was provided, I can still post empty fields. The > > > "notEmpty" validation doesn't weed out the empty submission. Any > > > ideas? > > > > Here's the model: > > > > <?php > > > class Post extends AppModel > > > { > > > var $name = 'Post'; > > > > var $validate = array( > > > 'title' => array( > > > 'rule' => 'notEmpty' > > > ), > > > 'body' => array( > > > 'rule' => 'notEmpty' > > > ) > > > );} > > > > ?> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
