Questions tagged [slim-3]

Slim 3 is the successor to Slim 2, a micro framework for PHP.

Resources

Related tags


For the Ruby template engine use instead.

414 questions
3
votes
1 answer

Slim 3 - Error is not shown

I am trying to use zeuxisoo/slim-whoops to show errors, but for some reason I am only getting white screen without any message show. This is the code I am using (I don't know if it does matter, I am using quick PHP host (php -S…
Sasha
  • 7,725
  • 21
  • 78
  • 154
3
votes
1 answer

Slim 3 sending data between middlewares

I want to send data between one middleware to other. As one middleware passes, I want to add some JSON response and pass to next middleware. What can be the best possible way to do it in Slim 3. For…
Mehul Jain
  • 113
  • 8
3
votes
1 answer

Catchable fatal error with Slim 3 in my Models, must implement interface Interop\Container\ContainerInterface

I am getting an Catchable fatal error with Slim 3 on my Models, i have a similar set up on my Controllers and it works just fine. When i implement the same on my Modal class i get the following error. Catchable fatal error: Argument 1 passed to…
John
  • 101
  • 10
3
votes
1 answer

Multiple Slim routes with the same signature

We are looking at using Slim 3 as the framework for our API. I have searched SO and the Slim docs, but cannot find an answer to the issue. If we have different route files (e.g. v1, v2, etc.) and if two routes have the same signature, an error is…
TheAnswerIs42
  • 55
  • 1
  • 7
3
votes
3 answers

Access current route name in Slim3 controller's class constructor

With Slim I group my controllers and generally have an abstract BaseController I extend for each group. I use class based routing: /* SLIM 2.0 */ // Users API - extends BaseApiController $app->post('/users/insert/' ,…
Eko3alpha
  • 537
  • 6
  • 16
2
votes
2 answers

How to read the response body when API error happen using curl?

I developed an API using Slim v3, when an exception is raised I have an ErrorHandler which return the following: public function __invoke(Request $request, Response $response, \Exception $exception) { $status = $exception->getCode() ? : 500; …
sfarzoso
  • 749
  • 1
  • 6
  • 29
2
votes
1 answer

Respect Validation php slim custom messages

I've read the docs and I wonder if its possible to make custom messages based on rules AND attribute, for example I have the following code $casoValidator = …
JoseCarlosPB
  • 785
  • 2
  • 10
  • 24
2
votes
2 answers

Slim 3 PHP - can't access values in settings.php from middleware.php

I have a midleware that checks for a valid signature on a JWT token for GET requests to private routes. In it, I need to supply my JWT secret which is stored in settings.php at ['settings']['jwt']['secret']. I tried accessing this value using…
Daveh0
  • 663
  • 5
  • 17
2
votes
1 answer

Howto use Quasar with SlimPHP and Twig

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs. Twig is a fast, secure, and flexible PHP template engine. The challenge is to use these two components and use Quasar Framework too.…
Edgar Koster
  • 407
  • 5
  • 15
2
votes
1 answer

PHP Slim 3 - Accessing class object instances within a slim route

So I’m learning how to write a Slim 3 PHP authentication app and I'm using an example code structure to get me started. The example code has a file called dependencies.php which has a series of functions that create object instances of other…
GR412
  • 555
  • 1
  • 5
  • 22
2
votes
1 answer

Android retrofit 2, select video and upload to server

I'm writing programs to try to learn Android. I'm trying to get a video to upload to the server with retrofit. My retrofit works uploading EditText etc. I'm using the same IP address here as I do there. In the code the camera works fine records…
gtcode
  • 47
  • 1
  • 6
2
votes
1 answer

Twig default to text within block if block is empty?

On my template I am using the following to define a og:meta image url, some pages will override this. Now, what I want to do is have a default image there if the block is…
Joe Scotto
  • 8,050
  • 7
  • 41
  • 100
2
votes
1 answer

SLIM FRAMEWORK 3: Can't pass variable from middleware to controller

What's wrong with my code? I can't pass variable from my Auth middleware to controller. In controller, the attribute "null". Index: $c = new \Slim\Container($configuration); $api = new \Slim\App($c); $api->group('/', function () use ($api)…
user3700786
  • 149
  • 1
  • 12
2
votes
2 answers

Is it possible to use PHP-DI definitions instead of Eloquents Capsule Managers Built in IoC within Slim 3?

I am currently working on a slim 3 application that is using a php-di bridge to serve dependencies. Everything is working flawlessly within controllers, however, I came across an issue when trying to add dependencies to a model observer. Eloquents…
Derek Gutierrez
  • 610
  • 1
  • 6
  • 15
2
votes
2 answers

Data passing with array format

How to pass data in array format using jquery / slim 3 my code : $.each(data.shortlisted, function(index,element) { // alert(element.job_title); $('#studentlist').append('
Sara Sam
  • 78
  • 10
1 2
3
27 28