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.

421 questions
0
votes
0 answers

How to limit results by user globally in Eloquent?

I am using eloquent as part of a slim 3 project with slim-jwt-auth (https://github.com/tuupola/slim-jwt-auth), outside of Laravel. There are many situations where I want to control the items returned based on the user who is making the request. From…
Finglish
  • 9,692
  • 14
  • 70
  • 114
0
votes
1 answer

Using TCPDF across multiple classes

I am trying to write a function that would call multiple classes, each would add a widget to a single PDF file and then return that entire PDF file. Here's the constructor's code:
Naguib Ihab
  • 4,259
  • 7
  • 44
  • 80
0
votes
1 answer

Phinx Class Not Found PHP

So I'm trying to set up Phinx a database migrations tool in Slim however, I'm having a little trouble getting the migration to work properly it keeps giving me this error Fatal error: Class 'App\Database\Migrations\Migration' not found in…
Hassan
  • 43
  • 1
  • 3
0
votes
2 answers

Slim Framework 3 RESTful Backend - Serving Images

When uploading images on my web application, images are stored in the /public/uploads/ directory. For those familiar with Slim Framework 3 the /public/ directory is where index.php is stored. Simply navigating to http://website.com/uploads/image.png…
Jordan
  • 231
  • 1
  • 12
0
votes
1 answer

dependencies usage in Slim 3

Hi I have the follwong dependencies: $container['controller'] = function($c) use ($app) { return new controller( $app ); }; $container['utils'] = function($c) use ($app) { return new utils( $app ); }; $container['model'] = function($c) use…
fstdv
  • 53
  • 1
  • 9
0
votes
0 answers

Slim 3 src-attribute route error on mobile internet

In my Slim 3 Controller I use a function to return images from a non-public folder. I put the route to this Controller in an img tag like so: Everything works fine as long as I access my webpage via WIFI.…
Benni
  • 1,023
  • 11
  • 15
0
votes
0 answers

Adding HTTP cache to slim 3

I have a route : $app->get('/api/home',['\App\Controllers\HomepageController','getAllCards']); In my App.php file, I have registered the service provider as: $dependencies = [ 'cache' => function(Container $container) { return…
Ayush28
  • 359
  • 3
  • 18
0
votes
1 answer

Slim3 telling me that callable route can't be found

I'm new to slim. I ran into an error telling me the callable controller does not exist. However my other controller (HomeController) does work. I'm sure I am doing something stupid but I can't figure out what. Error Message Type:…
JoeyD473
  • 2,890
  • 2
  • 21
  • 25
0
votes
1 answer

Slim Framework response incredibly slow when returning JSON

I'm building a simple API based on Slim framework 3.8.1. I'm having an issue where the response is taking ~10 seconds to render. I've verified by process of elimination that it's the actual render of the response that's taking ~10 seconds--- it's…
tom f
  • 370
  • 3
  • 16
0
votes
2 answers

How to use monolog in slim 3?

In my app.php file: use Monolog\Logger; use Monolog\Handler\StreamHandler; class App extends \DI\Brifge\Slim\app { public function configureContainer(ContainerBuilder $builder) { $dependencies = [ 'logger' => function (Container…
Ayush28
  • 359
  • 3
  • 18
0
votes
0 answers

Integrating PHPBB into Slim 3

Has anyone managed to integrate PHPBB login system with a Slim 3 application? I get the following error Fatal error: Uncaught TypeError: Argument 1 passed to Slim\Collection::__construct() must be of the type array, object given When adding…
0
votes
1 answer

Delete query builder in laravel/eloquent using slim3 returning integer 0

I am using slim3 eloqent/laravel and am trying to build a query to delete an entry from the database using multiple where clauses. According to laravel's documentation this query should delete correctly; $deleteGalleryItem =…
mp252
  • 453
  • 1
  • 6
  • 18
0
votes
0 answers

Twig nested foreach loop not showing results

I am building a simple chat system for users within my DB, and I want the user to be able to reply to messages, but to show in chronological order. I cannot get the nested foreach loop to show any results. Here is what i have so far. Friends…
John
  • 111
  • 10
0
votes
2 answers

Slim 3 Http Delete method not working

I am trying to implement http DELETE. The app is written with php and slim3 framework. The frontend is angular 2. If the pattern looks like:$slimApp->delete('/delete', ...) everything is fine. As soon as I introduce params like:…
kemal89
  • 931
  • 2
  • 8
  • 20
0
votes
1 answer

Paasing URI parameters in the route when using controller function in Slim framework

How can I pass URI parameters in the route when using controller function? For example: $app->get('/api/courts/{id}/{date}', 'C:\xampp\htdocs\backend\App\Controllers\AvailabilityController: getCourtAvailability'){ …
Ayush28
  • 359
  • 3
  • 18