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

how to use variable in static function with MODE_DEFAULT

$message = 'Email already taken'; class EmailUniqueException extends ValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ self::STANDARD => 'put $message here', ], ]; } I have the code above, in the…
0
votes
3 answers

Passing data via AJAX responds in NULL values

Passing additional data to my REST server doesn't work quite well. I have this simple ajax call: // Client $(document).on('click', '#car', function(e){ e.preventDefault(); var name = $(this).data('name'); // Tesla var model =…
Magiranu
  • 299
  • 4
  • 27
0
votes
0 answers

How to modify Twig template data from Slim Response object?

Is there a way to modify the template data for Twig/Slim via the Response object? Otherwise, what is the recommended strategy to load and populate forms from a failed form submit? class Item extends Model {} // eloquent model class ItemOption…
Jake
  • 11,273
  • 21
  • 90
  • 147
0
votes
1 answer

Slim 3 post data

I keep getting these errors: Undefined index: fname in C:\wamp\www\legitapi\src\public\index.php on line 38 and Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in…
0
votes
1 answer

How to get an email with log details when errors occur with Slim and Monolog

My website is built over Slim Framework V3, and uses Monolog. I want to get an email notification when something goes wrong on my website (any log message above Error). In other words, I want to know when a Critical, Alert or Emergency message is…
Gabriel Bourgault
  • 842
  • 11
  • 22
0
votes
1 answer

How to get slim-csrf token in Vue?

What's the best way to get the csrf token in VueJS? I don't have any idea to access the token via VueJS. Should it be an ajax call? But, I think it'll be risky, right?
Terry Djony
  • 1,975
  • 4
  • 23
  • 41
0
votes
2 answers

Microsoft-Graph refresh-token request fails... AADSTS70000

I am using league/oauth client with guzzle in a Slim3 WebApp working with Microsoft Graph... and I am not able to successfully request a new token by given refresh token... this is my di-container for league/oauth-client: $container['oauthprovider']…
0
votes
1 answer

How to inject more complex service in slim3 such as Paytrail

Below is an example code for "Paytrail_Module_Rest.php", a set of classes for interacting with a rest api for a payment gateway. Some of the classes can be instantiated ahead of time such as (Paytrail_Module_rest which holds credentials), but some…
Finglish
  • 9,692
  • 14
  • 70
  • 114
0
votes
1 answer

Authentication Middleware Slim 3.0

I am using a middleware to redirect to login page if session is not set. $app->get('/dashboard', function (Request $request, Response $response, $args) { include_once('employee-portal/dashboard.php'); return $response;})->add(new…
Saikat Bepari
  • 121
  • 1
  • 14
0
votes
0 answers

Encrypted Cookies in Slim Framework v3

I am writing and application in Slim Framework v3.1. I am a lot confused on how to correctly set and get the cookies using Slim's methods. I need your help in understanding what is the right way to read and write cookies with encryption enabled. I…
ArunKolhapur
  • 5,805
  • 4
  • 18
  • 31
0
votes
1 answer

ramsey/uuid - validate a name-based hashed has the name that we assign it to the uuid

Any reliable uuid package from Packagist that I can download and use it for Slim framework? Ideally,I would an uuid that I can hash a type, e.g. php, into the string. then i can check if that uuid has 'php'. EDIT: How can I validate a name-based…
Run
  • 54,938
  • 169
  • 450
  • 748
0
votes
1 answer

slim 3 regex route

I'm trying to match a route that has the keywords -episode or -movie. Such as /steins-gate-episode-1 or /pokemon-movie-10 I tried doing this: $app->get('/{slug:episode|movie}', \App\Controller\EpisodeController::class . ':getBySlug'); But it isn't…
0
votes
2 answers

Empty PHP response object in AJAX but only on success

To receive my response object from my PHP server I have the code down below. First of all, it works. What does not work is that if my first PHP condition is met, the success function in my Ajax responds correctly but only without using the data…
Magiranu
  • 299
  • 4
  • 27
0
votes
1 answer

how to store posted parameter in array using slimframework 3

i want to store the posted parameters to my function in an array, i am using slim 3 My question is the request->getparam('') how i should get the parameters posted ? should i bind them ? if so to what should i bind them since i am not using…
mirvatJ
  • 366
  • 1
  • 3
  • 15
0
votes
1 answer

securing slim 3, RESTful API

I know how to implement token based authentication. But my concern is user actions like register,login or verify, against attacking bots. I can imagine a bot making requests through fake phone numbers and my SMS or mail server will respond all of…
Vahid Alimohamadi
  • 4,900
  • 2
  • 22
  • 37