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
1 answer

Eloquent :: One to One where active in both tables, but specific roles

I am trying to only return specific profiles for users that have roles (role_id 5 & 6) that are active in both tables. It would also be nice if I can order by first_name ASC as well (user…
Dan Kinchen
  • 117
  • 1
  • 8
0
votes
1 answer

try catch block is not working with success return

In my code, when the function throws an error such as, organisation name is required or it is alread exists, the catch block works properly. But in the case of success, eventhough the corresponding organisation is inserted,i got the status of 200…
shalin
  • 373
  • 3
  • 19
0
votes
1 answer

Slim 3 Framework Error when Creating php shopping cart

Hi Ive been trying to create a shopping cart via php. To do this I have been using the Slim 3 Framework, however I've run into some error and I can't seem to understand what the issue is. Any help is appreciated, thanks! Error Log from…
Advait Kulkarni
  • 139
  • 2
  • 12
0
votes
1 answer

Slim RuntimeException when extending a controller class

The error is: Fatal error: Uncaught exception 'RuntimeException' with message 'Unexpected data in output buffer. Maybe you have characters before an opening I have built a pretty simple controller class to handle the routing and rendering of an…
nerdlyist
  • 2,842
  • 2
  • 20
  • 32
0
votes
4 answers

Installing Slim 3 using Composer

Hello. Please I am new to the php slim framework. I have tried all day to download and install slim 3 through composer but haven't been successful. Am using a windows pc. I used command prompt and downloaded composer and installed composer to the…
Pedestal
  • 21
  • 1
  • 4
0
votes
2 answers

Return already formatted JSON - Slim Framework

Im using Slim Framework to return a result already in a JSON format. $app->get('/forecast_range/{latitude}/{longitude}/{timeStart}/{timeEnd}', function (Request $request, Response $response) { $latitude = $request->getAttribute('latitude'); …
Andre Garcia
  • 894
  • 11
  • 30
0
votes
1 answer

Slim 3 middleware validation

I'm trying to implement json-schema validator from justinrainbow as middleware in Slim 3. I can't figure out how to get the clients input from GET/POST requests in middleware. tried like this: $mw = function ($request, $response, $next) { …
Nikita P
  • 149
  • 5
  • 19
0
votes
1 answer

How to get the Twig object out of the container?

I'm using Slim Framework 3 with PHP-DI/Slim-Bridge. This is my container: $builder->addDefinitions([ 'settings.displayErrorDetails' => true, 'router' => get(Router::class), Twig::class =>…
Brent
  • 21
  • 1
  • 6
0
votes
1 answer

Error: Slim instance must be Slim\Views\Twig, Slim\Container given

I'm trying basic container tutorials on Youtube, and I'm stuck on this part. I made sure that a twig instance is given and not a container, but the error still appears. heres the container part of index.php: $container['view'] = function…
gkhnavarro
  • 446
  • 2
  • 14
0
votes
1 answer

Slim 3 activate custom error handler

In Slim 3, here's an example of a custom error handler injected in the app: $container = new \Slim\Container(); $container['customError'] = function($c){ return function ($request, $response) use ($c) { $output = ['success'=>0,…
nekosama
  • 13
  • 4
0
votes
1 answer

Slim3 right way to set errors and check is user logged in

I'm a new user of Slim framework, I've a simple Slim 3 application, with sign in and sign up validation. But I'm not really sure if this is the right/best way to set errors and check if user is logged in -In order to redirect it to his account if…
Yassine Addi
  • 47
  • 1
  • 8
0
votes
1 answer

Get POST PUT parameters with Slim 3

I'm trying to build a full REST API with Slim 3. It was quite easy with Slim 2. But now I've got some issues. The POST and PUT route does not work has expected. I can't get the parameters. I found the $request->getHeaders() on the documentations,…
TDK
  • 161
  • 2
  • 13
0
votes
2 answers

Slim v3 and twig ( View Page displays page not found error)

I have installed slim framework 3 and twig template following the composer. When i call function http://localhost/elec/helloo/sandesh it displays Hello, Sandesh as followed on slim 3 documentation. But when i try to call view page(inside…
sandesh phuyal
  • 111
  • 2
  • 13
0
votes
1 answer

How can I call commoly used functions in slim 3 framework?

I am building my website in Slim 3 MVC framework.I need to call some commonly used functions for controller (Eg: For Alias of page title I am using a function called function getAlias(){.....}). Where I have to create those functions? How can I call…
Sandeep Bhaskaran
  • 621
  • 1
  • 7
  • 14
0
votes
1 answer

Slim 3.3 missing characters in output

I'm trying to get Slim to run on my Windows 7 system. So far I've gotten everything installed with Composer but when I run a very simple program, the output is not as intended. Below is my code:
Stefan
  • 301
  • 3
  • 14