Questions tagged as 'slim'

1
answer

Error "Using $ this when not in object context" in the Slim framework

I have the following error:    Fatal error: Using $ this when not in object context in   C: \ Users \ PC \ Desktop \ slim_framework \ app \ Controllers \ HomeController.php   online 10 composer.json { "require": { "slim/sl...
asked by 26.11.2017 / 01:09
1
answer

Error passing array as parameter to Eloquent object

I'm having trouble inserting a record of type 1: N using Eloquent. When I pass the array with the attributes to the object as the documentation guides an error is thrown and when I print the error with echo $ex->getMessage() the only t...
asked by 22.08.2017 / 22:30
2
answers

Error installing Slim framework

How to fix the error below using the composer. composer.json code already created in bin \: { "require": { "slim/slim": "2.*" } }     
asked by 05.06.2017 / 22:33
1
answer

Web service for web / android

I have the following web service $app->get('/alunos', function(){ require_once('db/config.php'); foreach ($db->alunos() ->order("nome") as $row){ $data[]=$row; } echo json_encode($data, JSON_UNESCAPED_UNICO...
asked by 07.01.2018 / 13:43
1
answer

Problem with json slim framework

I am doing an api to do the integration of two different systems, the system sends me the following json: cJson = [{"TESTE": "1"}] I was 3 days with a problem because I was not able to get the json that the other system sent me via post wit...
asked by 21.06.2017 / 17:16
1
answer

Slim framework error: call require '../Slim/Slim/Slim.php';

Error creating when calling function Slim.php Code: <?php require '../Slim/Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $app = new \Slim\Slim(); $app->response()->header('Content-Type', 'application/json;char...
asked by 07.06.2017 / 20:55
1
answer

Print a session variable through the twig engine

I entered a variable in the session named $_SESSION['ano'] . I would like to print your value on a page using twig. I've tried: {% for ano in app.session %} {{ ano }} {% endfor %} But it does not work. How can I do it? The fr...
asked by 23.01.2017 / 14:31
1
answer

Rest Web Service using Slim Framework, in PHP, always gives error when called by an Ajax method, although it is executed?

I've implemented a WS Rest in PHP, but when I try to consume WS with an Ajax method it always returns me the error function. However the WS is recorded and the data is even recorded in the DB. Has anyone ever had the same problem? PHP WS code...
asked by 19.04.2016 / 13:06
1
answer

Slim Framework - DELETE and Framework Function

I'm having problems with the slim DELETE, it has a 404 error, follow the code: <?php require '../Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $app = new \Slim\Slim(); $app->response()->header('Content-Type', 'application/json;ch...
asked by 18.03.2016 / 18:53
1
answer

Redirect Rest service with .htaccess

I have a folder in my project called api , and inside it a .htaccess file that should redirect the requests (made via jquery) to the app/controllers/rest/ folder which also has a file .htaccess and a file named en...
asked by 17.03.2015 / 04:13