Hello Community,

I want to create a url like this.

http://localhost/cakephp/incomings/request/?msisdn=919871701375&operator=AIRTEL&circle=DELHI

and i am accepting this request in my controller like below code and
passing it to model for validation but it is not working in case i
left any variable above blank like (circle=) or (msisdn=)

incomings_controller.php

<?php
class IncomingsController extends AppController {
var $name = 'Incomings';
function request() {
$this->Incoming->set($this->params['url']);
$this->Incoming->validates();
}
}
?>

incoming model:

<?php
class Incoming extends AppModel {
var $name = 'Incoming';
var $validate = array(
'msisdn' => array(
'rule' => 'notEmpty',
'required' => true,
'message' => 'Please enter a valid msisdn',
'last' => true
),
'operator' => array(
'rule' => 'notEmpty',
'required' => true,
'message' => 'Please enter a valid operator',
'last' => true
),
'circle' => array(
'rule' => 'notEmpty',
'required' => true,
'message' => 'Please enter a valid circle',
'last' => true
)
);
}

?>

Please suggest.

Regards
Tapan Thapa
India
tapan.th...@yahoo.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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

Reply via email to