Hi everyone, I’m struggling with “Internal Server Error”…
It seems to depend on the table that was “baked” in the console.
I’m suspecting that it is the foreign keys that are causing these errors since those forms are mostly effected by these error.
So I decided to make one from scratch called persons. The internal server error occurred here as well.
Here are the code in table, entity, controller and template.
Table:
namespace App\Model\Table;
class PersonsTable extends Table
{
public function initialize(array $config): void
{
$this->addBedhavior(‘Timestamp’);
}
}
Entity:
namespace App\Model\Entity;
use Cake\ORM\Entity;
class Person extends Entity
{
protected $_accessible = [
‘*’ => true,
‘id’ => false,
‘email’ => false
];
}
Controller:
namespace App\Controller;
class PersonsController extends AppController
{
public function index()
{
$this->loadComponent(‘Paginator’);
$persons = $this->Paginator->paginate($this->Persons->find());
$this->set(compact('persons'));
}
}