CakePHP - Data validtation

Discussion in 'PHP' started by heroic, Jun 23, 2010.

  1. #1
    Hi, i am using cakePHP for a simple script and i am trying to validate the inout fields... The code seems to be ok, but for some reason it is not validating the data...

    plz help!

    The model
    <?php
    
    class inviteApply extends AppModel {
        var $name = 'inviteApply';
    	var $validate = array('email' => 'email');
    	}
    ?>
    PHP:
    The controller

    
    $this->inviteApply->set($this->data);
    if ($this->inviteApply->validates())
    	{
    		$this->inviteApply->save($this->data);
    	}
    else 
    	{
    		print_r($this->Product->invalidFields());die();
    	}
    
    PHP:
    Thanx :)
     
    heroic, Jun 23, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not sure if this is of use to you but it will create the validation rules for your application input
    http://www.validcake.com/
     
    JAY6390, Jun 23, 2010 IP
  3. heroic

    heroic Peon

    Messages:
    252
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I tried that too, on your recommendation... still the same error... Newaz thanks for trying :)
     
    heroic, Jun 23, 2010 IP
  4. getlandersgetpaid

    getlandersgetpaid Guest

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Have you tried the cakephp IRC channel? They can usually help you out pretty fast ;)
     
    getlandersgetpaid, Jun 23, 2010 IP