var $validate = array(
'name' => array(
'rule' => array('custom', VALID_NOT_EMPTY),
'message' => 'Can\'t be empty'
)
);
This is how i deal with not empty values. VALID_NOT_EMPTY may be
deprecated, but still it's just a constat so i can replace it wi
> The 'allowEmpty' key should be assigned a boolean value.
Ah, thank you. That makes sense. So I've replaced this:
var $validate = array(
'name' => array(
'required' => VALID_NOT_EMPTY
)
);
With this now:
var $validate = array(
'name' => array(
array(
'mes
in 1.2, it is required to be set in a string, or you could use the following
validation rule:
"allowEmpty The 'allowEmpty' key should be assigned a boolean value. If '
allowEmpty' is false, data passed to the model's save() method must include
the field and a non-empty data value for that field. T
> also, in regards to the second error, make sure in your model->validate
> array, that you have apostrophes around the words 'VALID_NOT_EMPTY', which
> should clear out that error.
Will it? I thought VALID_NOT_EMPTY *was* a constant, not a literal
string.
I've also heard on someone's blog that
also, in regards to the second error, make sure in your model->validate
array, that you have apostrophes around the words 'VALID_NOT_EMPTY', which
should clear out that error.
On Feb 8, 2008 7:15 AM, MonkeyGirl <[EMAIL PROTECTED]> wrote:
>
> > The code i have creates my user and puts it into the
> The code i have creates my user and puts it into the database just
> fine..but after that, nothing happens... no flash, no redirect.
Have you made a login() function in /app/controllers/
users_controller.php? It looks like you've got the creation of new
users sorted, but you now need to let the
>From the first Error message It looks your Cache directory is not
writable.
and The third message regarding Cannot modify header information..
I Use Writing
ob_start(); just next line to PHP start tags before starting my
controller class and ob_clean(); just before my php end tags and after
no luck yet, I tried this as well:
$this->redirect(array('controller'=>'users','action'=>'login'));
I'm also getting these things in the debug area...
Warning (512): /var/www/html/bradsCakeApp/app/tmp/cache/ is not
writable [CORE/cake/libs/cache/file.php, line 263]
Notice (8): Use of undefine
try using the full path in the login redirect, i.e.
$this->redirect('/users/login');
you also should add the 'true' tag, if you are using CakePHP1.2, to
automatically call the exit() function after the redirect.
i.e.
$this->redirect('/users/login', true);
Hope this helps!
On Feb 7, 2008 5:43 PM,