zac bansil
zac bansil

Reputation: 1

Slim Application Error (website error occurred)

Good day ! I always get this error " (A website error has occurred. Sorry for the temporary inconvenience)." every time I try to run my codes in postman. And here's my codes.

<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

require '../vendor/autoload.php';
require '../includes/DBOperations.php';

$app = new \Slim\App;


$app->post('/createClient', function(Request $request, Response $response){

if(!haveEmptyParameters(array('lastname','firstname','midname','contactnum','emailadd','password'),$response)){

$request_data = $request->getParseBody();
$lastname = $request_data['lastname'];
$firstname = $request_data['firstname'];
$midname = $request_data['midname'];
$contactnum = $request_data['contactnum'];
$emailadd = $request_data['emailadd'];
$password = $request_data['password'];
$hash_password = password_hash($password, PASSWORD_DEFAULT);

$db = new DBOperations;

Upvotes: 0

Views: 5132

Answers (1)

Eben
Eben

Reputation: 61

The comment from @Dale about adding the below LOC helps:

$config = ['settings' => ['displayErrorDetails' => true]]; 
$app = new Slim\App($config);

Upvotes: 4

Related Questions