Questions tagged [slim]

Slim for PHP is a RESTful micro framework for PHP 5 inspired by Sinatra.

  • Slim 3 requires PHP 5.5.0 or newer.

Resources

Features

  • Router Slim uses the FastRoute router and maps route callbacks to specific HTTP request methods and URIs. It supports route segment parameters and pattern matching.

  • Middleware Build your application with custom concentric middleware to tweak the HTTP request and response objects before and after your Slim app runs.

  • HTTP Slim has easy-to-use PSR-7 request and response abstractions that let you inspect and manipulate HTTP messages' method, status, URI, headers, cookies, and body.

Related tags


For the Ruby template engine use instead.

2828 questions
0
votes
1 answer

How to inject a service into Behat feature context in Slim 4 framework

When I search for service injection to feature context I always find extensions for symfony. But I need extension or something else to do this in Slim 4 framework. Thank you.
Furkan
  • 415
  • 5
  • 17
0
votes
1 answer

Slim3 redirect GET request as POST request

Just started learning Slim3. Have been spending some time figuring out how to perform redirects with overriding original request type with no success. I want the /origin route to perform the redirect to /dest route. /origin route receives GET…
vai bai
  • 1
  • 2
0
votes
2 answers

OPTIONS request before GET request with Authorization Header not working in slim framework 4

I have cloned slim skeleton (https://github.com/slimphp/Slim-Skeleton) which already have CORS implemented. But still when API calls OPTIONS before GET, it sends 405 ERROR "Method not allowed. Must be one of: GET" Here is my route where I face this…
Ankur
  • 519
  • 8
  • 15
0
votes
2 answers

Slim Framework : Call internal API REST

I've created API REST collections on my project that will be called both internally (in the same PHP project) and externally (from other projects) My question is : What is the best way to consume internal API REST ? I've created a function to mock…
simhamed
  • 75
  • 1
  • 7
0
votes
0 answers

Page 404 not found but was working untill few times ago

I have an php backend, with 3 classes that manage my little program api rest, i done the first event.php and the api rest works well, so i done user.php same thing all working, then i done login.php and now works, but also the other pages are in…
matteo sperti
  • 31
  • 1
  • 7
0
votes
2 answers

PHP-DI not able to wire interface to implementation w/ slim bridge

I'm coming from the world of .net and DI/IOC containers like autofac, ninject etc. I expect, and php-di's documentation seems to imply the following should work: index.php / front controller $containerBuilder = new…
misterManager
  • 1,174
  • 4
  • 12
  • 33
0
votes
1 answer

In Slim Framework, what is a container and what is it for?

I am new to Slim Framework. There is this dependency container. What is that? How is it used? And can we avoid or not use that?
iiR
  • 707
  • 1
  • 6
  • 21
0
votes
0 answers

How to stop getting 'Required parameters' missing error when POST data using retrofit Android as POSTMAN does not showing this error?

I created a slim framework backend support for my app and i define a function which needs to check if parameters that are going to be POSTED,matching the required parameters to be posted.Now,when i send a POST request using POSTMAN, it is executed…
JaTiN
  • 1
  • 2
0
votes
2 answers

page not found when run slim in IIS

I'm trying to run slim application in IIS, I add it as Application in default web sites, I've imported rules from .htaccess and updated physical address to public, but I still got Page Not Found to be noticed that when I add it as a Web site ( not…
Kenana Reda
  • 430
  • 1
  • 9
  • 24
0
votes
1 answer

Slim autoloader & namespace issue

I reckon my problem is quite common but even with the mass of doc on namespacing I can't figure out what's wrong with my code. So I'm using Slim 4.1 and I've put my workfiles in the folder Custom/ in the app/ folder. public/ -- index.php app/ --…
user12009509
0
votes
2 answers

URL not found when trying to use slim framework with PHP and Apache

I have this code using the slim framework and php with apache2 on linux:
digitalXmage
  • 23
  • 1
  • 7
0
votes
2 answers

SOLVED)How to remove '/index.php' from slim framework url

My development environment is Ubuntu 14.04.6 LTS Apache 2.4.7 mysql is 5.6.33 my directory is /var/www/html/your-app |--public |-- .htaccess | `-- index.php `--app …
김태현
  • 1
  • 2
0
votes
1 answer

How to return a Slim response from a subfunction call?

This controller (called via the __invoke function) calls another function to process some data, I would like to return a response on error from the second function processData, is it possible? public function __invoke(ServerRequestInterface…
Ploppy
  • 14,810
  • 6
  • 41
  • 58
0
votes
1 answer

How can I send a datastream and a String in one Response using Slim

I'm building a Slim API for an update tool. The goal of the whole thing is, after some checks,to respond to the client with a Zipfile. This works just fine. But I don't not only want to send the client the requested zipfile, in addition I also want…
jdoe
  • 99
  • 3
  • 14
0
votes
1 answer

How to I enable establish SMTP connection on Cpanel?

I want to be able o send an email from my application through SMTP and I don't want to use sendmail as a transport. $transport = (new \Swift_SmtpTransport('smtp.gmail.com', 465, 'ssl')) ->setUsername('afashaisakiye@gmail.com') …
iamafasha
  • 848
  • 10
  • 29
1 2 3
99
100