I'm new to cakephp and I was trying create a registration page and but
I can't validate the model
here's the model:
class TempModel extends AppModel{
var $validate = array(
'value1'=>array(
'rule'=> array('minLenght', 3),
'required'=>true,
'message'=>'The field is required'
),
'value2'=>array(
'rule'=> array('minLenght', 3),
'required'=>true,
'message'=>'The field is required'
)
);
}
the controller:
class TestingController extends AppController{
var $uses = array("Temp");
var $helpers = array("Html","Form");
function index(){
if(!empty($this->data))
$this->Temp->create();
if($this->Temp->save($this->data)){
$this->autoRender = false;
$this-
>set('a',"Saved");
$this->render('/testing/login');
}
}
function login(){
}
}
and the view:
<?php
e($form->create('Temp', array('url'=>'/testing/')));
e($form->input("value1"));
e($form->input("value2"));
e($form->end("Submit"));
?>
I really need help.
Thank you
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---