Re: Newbie question on form validating

2008-12-11 Thread gearvOsh

Yes, I was about to to point out that it might be because your model
file name is capitalized.

On Dec 11, 4:57 am, AJV  wrote:
> :D
>
> Well I guess I just confirmed my newbie status, I had written the
> names of the model files Capitalized. I noticed that small letters
> work much better :D
>
> Well, that was a fun couple of hours.
>
> Aapo
>
> On Dec 11, 2:49 pm, AJV  wrote:
>
> > I'm quessing this has something to do with communicating with the
> > model file. Even if I write die() or some broken code to the model,
> > nothing happens. Are there any ways to confirm that the controller
> > talks to the model, and if not, how could it be fixed?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Newbie question on form validating

2008-12-11 Thread AJV

:D

Well I guess I just confirmed my newbie status, I had written the
names of the model files Capitalized. I noticed that small letters
work much better :D

Well, that was a fun couple of hours.

Aapo

On Dec 11, 2:49 pm, AJV <[EMAIL PROTECTED]> wrote:
> I'm quessing this has something to do with communicating with the
> model file. Even if I write die() or some broken code to the model,
> nothing happens. Are there any ways to confirm that the controller
> talks to the model, and if not, how could it be fixed?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Newbie question on form validating

2008-12-11 Thread AJV

I'm quessing this has something to do with communicating with the
model file. Even if I write die() or some broken code to the model,
nothing happens. Are there any ways to confirm that the controller
talks to the model, and if not, how could it be fixed?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Newbie question on form validating

2008-12-11 Thread AJV

OK, thanks for that info!

Still, the problem persists.

I installed a fresh cake and made this tutorial:

http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2

But even though I followed every step, it just doesn't work, no
validation is happening.



On Dec 11, 1:48 pm, grigri <[EMAIL PROTECTED]> wrote:
> Yes; Cake supports dynamic models.
>
> If you don't create an actual model file, cake will instantiate an
> instance of AppModel with the name and useTable set up to work
> properly. This is only useful for basic models though as you can't
> specify associations, behaviors, validation or anything specific for
> the auto-model.
>
> Its main use is for join tables in HABTM.
>
> hth
> grigri
>
> On Dec 11, 11:29 am, AJV <[EMAIL PROTECTED]> wrote:
>
> > A small typo - the path to the model file is of course /app/models/.
>
> > BUT I just noticed that I can change the model file to whatever, even
> > remove it, and it still works. Is this normal?!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Newbie question on form validating

2008-12-11 Thread grigri

Yes; Cake supports dynamic models.

If you don't create an actual model file, cake will instantiate an
instance of AppModel with the name and useTable set up to work
properly. This is only useful for basic models though as you can't
specify associations, behaviors, validation or anything specific for
the auto-model.

Its main use is for join tables in HABTM.

hth
grigri

On Dec 11, 11:29 am, AJV <[EMAIL PROTECTED]> wrote:
> A small typo - the path to the model file is of course /app/models/.
>
> BUT I just noticed that I can change the model file to whatever, even
> remove it, and it still works. Is this normal?!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Newbie question on form validating

2008-12-11 Thread AJV

A small typo - the path to the model file is of course /app/models/.

BUT I just noticed that I can change the model file to whatever, even
remove it, and it still works. Is this normal?!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Newbie question on form validating

2008-12-11 Thread AJV

I'm really confused with this - can't get even the simplest examples
working.

I set a test case like this:

 array(
'rule' => array('email', true),
'message' => 'Please supply a valid email address.'
)
);

}
?>

###
data ) ){

if ($this->Contact->validates()){
echo "yes";
}

if( $this->Contact->save( $this->data ) ){
$lastId = $this->Contact->getLastInsertId();
$this->flash('Your new user has been created.','/c/
contacts/view/'.$lastId );
}
}
}
}
?>




Enter Contact Information



label('Contact.email', "Contact's E-mail"); ?>
error('Contact.email'); ?>
text('Contact.email', array('size' => '80') ); ?
>

 
submit('Check validity'); ?>


When I submit anything, like "" or "1oi321" or whatever,
everything validates. The e-mail addresses also validate, which is
nice :) but it clearly isn't working at all. What am I missing? Wrong
configuration? My cake version is 1.2.0.7692 RC3.


On Dec 11, 11:38 am, gearvOsh <[EMAIL PROTECTED]> wrote:
> I just finished doing this today, these two links should help:
>
> http://book.cakephp.org/view/125/Data-Validationhttp://groups.google.com/group/cake-php/browse_thread/thread/d5e98df3...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Newbie question on form validating

2008-12-11 Thread gearvOsh

I just finished doing this today, these two links should help:

http://book.cakephp.org/view/125/Data-Validation
http://groups.google.com/group/cake-php/browse_thread/thread/d5e98df32a08c5cd#
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Newbie question on form validating

2008-12-11 Thread AJV

Just starting on Cake (1.2.0). I'm trying to make a form that checks
if a code that a user has inputted is in the correct format, then
check if it's found in a database. If the first check/validation
fails, it returns the user to the first page and displays an error
above the code-field.

And I don't understand how it's done.

What are the steps in achieving this? Is there a tutorial about this?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---