I change old model Users in INVO on new from https://blog.phalcon.io/post/phalcon-2-1-beta-released
Internal Error Something went wrong, if the error continue please contact us
What am I doing wrong?
|
Mar '16 |
8 |
423 |
0 |
I change old model Users in INVO on new from https://blog.phalcon.io/post/phalcon-2-1-beta-released
Internal Error Something went wrong, if the error continue please contact us
What am I doing wrong?
there are quite a few inconsistent changes in 2.1.x, did you check the blog carefully to be sure you fixed all the "things"
https://blog.phalcon.io/post/phalcon-2-1-beta-released
but to make your life easier, go to your apache/nginx log and check whats the error there
[28-Mar-2016 20:22:24 Europe/Moscow] Wrong number of parameters
here what gave php. Where I can take more info?
this is the new syntax for validation, did you fix it in your project ?
namespace Invo\Models;
use Phalcon\Mvc\Model;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Email as EmailValidator;
use Phalcon\Validation\Validator\Uniqueness as UniquenessValidator;
class Users extends Model
{
public function validation()
{
$validator = new Validation();
$validator->add(
'year',
new Numericality([
'model' => $this,
"message" => 'enter year bla bla bla'
])
);
return $this->validate($validator);
}
}
In https://blog.phalcon.io/post/phalcon-2-1-beta-released return $this->validate(); but you say return $this->validate($validator); I have tried in various ways. It does not work. and further ... whether it is necessary at the beginning to put namespase or not? With namespase refuses to give Page. I have tried to pass the code debugger is not found anything suspicious. It comes to return and throws an exception
i am 100% sure in the blog is wrong. if you put directly this code it should work :
$validator = new Validation();
$validator->add(
'year',
new Numericality([
'model' => $this,
"message" => 'enter year bla bla bla'
])
);
return $this->validate($validator);
i find it a bit suspicious, because the exception was saying something about params... i dont know i might be mistaking
Izo you're a genius !!! This I did not realize something. 'model' => $ this, - it was not a blog https://blog.phalcon.io/post/phalcon-2-1-beta-released return $this->validate(); - it is not right. return $this->validate($validator); - it is right.
The blog is written the wrong code. It leads to errors.
Iso, thank you!!!