Controller:
class PeopleController extends \Phalcon\Mvc\Controller{
public function indexAction(){
}
public function CreatePersonAction(){
$person = new people();
$person->firstName=$this->request->getPost("firstName");
$person->surname=$this->request->getPost("surname");
$person->telephone=$this->request->getPost("telephone");
$person->email=$this->request->getPost("email");
$person->city=$this->request->getPost("city");
$person->country=$this->request->getPost("country");
$person->save();
if ($person) {
echo"Successfully Registered User!";
} else {
echo "Sorry, the following problems were generated: ";
foreach ($person->getMessages() as $message) {
echo $message->getMessage(), "<br/>";
}
}
}
}
Model:
<?php
class People extends \Phalcon\Mvc\Model{
}
I have tried implementing the getSource() method into the model as the phalcon docs suggest that but still not getting the desired output of saving the POST items to the database