so I'm following the basic tutorial. I've got the Users model created:
use Phalcon\Mvc\Model;
class Users extends Model
{
public $id;
public $name;
public $email;
}
I've created the registerAction method:
public function registerAction()
{
$user = new Users();
$user->assign(
$this->request->getPost(),
null,
[
"name",
"email",
]
);
var_dump($this->request->getPost());
echo '<br>';
var_dump($user);
$success = $user->save();
if($success) {
echo 'thank you for registering.';
} else {
echo 'sorry, the following problems were generated: ';
$messages = $user->getMessages();
foreach($messages as $message) {
echo $message->getMessage(), '<br>';
}
}
$this->view->disable();
}
the var_dumps are giving me:
Array(2) { ["name"]=> string(3) "me" ["email"]=> string(14) "[email protected]" }
object(Users)#35 (18) { ["id"]=> NULL ["name"]=> NULL ["email"]=> NULL
so somewhere, that assign is borking.
Where?
Thanks.