cake-php@googlegroups.com
[Top] [All Lists]

Re: Validation Question

Subject: Re: Validation Question
From: "Dr. Tarique Sani"
Date: Thu, 17 Feb 2011 17:40:57 +0530
Damn!! now I am pissed - zip up your model and controller files and
paste a URL to download

I want the actual files you are using not cut and paste

Tarique


On Thu, Feb 17, 2011 at 5:35 PM, Tapan Kumar Thapa
<tapan.thapa@xxxxxxxxxxxxxxxxxx> wrote:
> If i put debug statement nothing gets print in my incoming view.
>
> If i also put die statement then complete page dies and i got blank white
> blank page.
>
> <?php
>
> class IncomingsController extends AppController {
>
>     var $name = 'Incomings';
>
>     function request() {
>         $this->Incoming->set(array(
>             'Incoming' => $this->params['named']
>         ));
>         debug($this->Incoming->validates());
>         //die(debug($this->Incoming->validationErrors));
>         /* $this->Incoming->set($this->params['named']);
>           if ($this->Incoming->validates()==TRUE) {
>           $this->Session->setFlash("Correct");
>           } else {
>           $this->Session->setFlash("Incorrect");
>           } */
>     }
>
> }
>
> ?>
>
> Please suggest...
>
> Regards
> Tapan Thapa
>
> On Thu, Feb 17, 2011 at 5:14 PM, Jeremy Burns | Class Outfit
> <jeremyburns@xxxxxxxxxxxxxxx> wrote:
>>
>> Try something for me...
>> debug($this->Incoming->validates());
>> die(debug($this->Incoming->validationErrors));
>> ...rather than checking for true or false.
>>
>> Jeremy Burns
>> Class Outfit
>> jeremyburns@xxxxxxxxxxxxxxx
>> http://www.classoutfit.com
>> On 17 Feb 2011, at 11:40, Tapan Kumar Thapa wrote:
>>
>> Still not working. :-(
>>
>> My Url:
>> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>>
>> My Controller:
>>
>> <?php
>>
>> class IncomingsController extends AppController {
>>
>>     var $name = 'Incomings';
>>
>>     function request() {
>>         $this->Incoming->set(array(
>>             'Incoming' => $this->params['named']
>>                 ));
>>         //$this->Incoming->set($this->params['named']);
>>         if ($this->Incoming->validates()==TRUE) {
>>             $this->Session->setFlash("Correct");
>>         } else {
>>             $this->Session->setFlash("Incorrect");
>>         }
>>     }
>>
>> }
>>
>> ?>
>>
>> My Model:
>>
>> <?php
>>
>> class Incoming extends AppModel {
>>
>>     var $name = 'Incoming';
>>     var $validate = array(
>>         'msisdn' => array(
>>             'required' => true,
>>             'allowEmpty' => false,
>>             'rule' => 'numeric',
>>             'message' => 'Please enter a valid msisdn',
>>         ));
>>
>> }
>>
>> ?>
>>
>> Please suggest.
>>
>> Regards
>> Tapan Thapa
>> India
>>
>> On Thu, Feb 17, 2011 at 4:58 PM, John Andersen <j.andersen.lv@xxxxxxxxx>
>> wrote:
>>>
>>> When you are setting the model data using the set() method, then you
>>> should provide it with at standard structure, not just the value of
>>> the msisdn parameter.
>>>
>>> [code example]
>>> $this->Incoming->set( array(
>>>   'Incoming' => $this->params['named']
>>> ) );
>>> [/code example]
>>>
>>> Enjoy,
>>>   John
>>>
>>> On 17 Feb., 12:09, Tapan Kumar Thapa <tapan.th...@xxxxxxxxxxxxxxxxxx>
>>> wrote:
>>> > I am dam got stuck here.
>>> >
>>> > Can some one suggest anything?
>>> >
>>> > BR
>>> > Tapan Thapa
>>> >
>>> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
>>> >
>>> >
>>> [snip]
>>>
>>> --
>>> 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+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group
>>> at http://groups.google.com/group/cake-php
>>
>>
>> --
>> 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+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>> --
>> 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+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
> --
> 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+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 
=============================================================
PHP for E-Biz: http://sanisoft.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+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php

<Prev in Thread] Current Thread [Next in Thread>