To receive the response object from my PHP server I thought you could just put the name of the variable into the success function and work on it.
Unfortunately this doesn't work. Is there anything which is wrong with my code? I'm using a framework…
I'm currently trying to get familiar with Slim 3 and just want to add a simple controller.
Error message:
Details
Type: Error
Message: Class 'app\controllers\HomeController' not found
File: C:\xampp\htdocs\slim\app\config\dependencies.php
Line:…
I am writing Slim3 API, for some reason slim is not loading namespace defined in composer.
Here is the project structure.
FolderStruc:
projectApi
- composer.json
- src
- public
- index.php
- ProjectName
- Api
-…
How can I use paginate function from Eloquent in Slim 3 project using twig ?
This is in my controller :
$posts = Sound::paginate(2);
$this->container->view->render($response, 'admin/sounds/index.twig', [
'posts' => $posts
]);
This is the view…
I am trying to retrieve users that were friend requested in ios app and return them into a friend request list in app. To do this I am using a PHP function that queries the notification table for the user_id it was sent from, then return all all…
Is there anyway in Slim 3 to get the previous route name or uri, similar to Laravel's back() helper?
It doesn't have to be specific to Slim, I am just trying to redirect back to the previous page.
Thanks :)
I am curently trying to integrate some Angular 2 frontend with Slim 3 PHP backend. I have the following Angular 2 service:
import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from '@angular/http';
import…
I'm building a webshop based on the slim3 framework. I need to handle a server-to-server POST-request to confirm if payment was successful. I added csrf to the container like this:
$container['csrf'] = function($container) {
return new…
I have a post function to insert info about the process on database and send email to one recipient.
$app->post('/sendemail', function ($request, $response) {
//Save info process
$message = saveDataBaseInfo();
if ($message == "OK") { …
So this is my first time trying to install and use composer and other packages.
I installed composer and slim 3 on my localhost, and it is working just fine.
I then went ahead and installed it with SSH on my remote server.
No errors occurred, and…
I'm am using the Slim Framework v3 and have some problems with accessing the JSON data I'm sending from a browser client to my REST API.
Currently I'm using $request->getParsedBody(); to access the data, but all it returns is a string and I don't…
I want to use sub routes with Slim Framework v3.2.0 like so:
www.test.com/ <-- index page
www.test.com/foodtype/ <-- separate page
www.test.com/foodtype/page/ <-- subcategory of foodtype
As I understand it, only one get can be called. Currently I…
I am following the Destructy tutorial and, after setting up and testing out the database connection I get the following error:
So far, this are my settings:
return [
'settings' => [
'displayErrorDetails' => true,
],
'url' => …
What is HTTP Cache for? How do I use it in Slim 3?
But I am not quite sure how this is done in Slim 3:
use Slim\Http\Request;
use Slim\Http\Response;
require_once __DIR__ . '/../vendor/autoload.php';
// Register service provider with the…