Questions tagged [slim]

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

Filter by
Sorted by
Tagged with
3 votes
2 answers
406 views

To-do app API made with Slim 3

I have put together the back-end (API) with the Slim framework (v3) and MySQL. In index.php I have: ...
Razvan Zamfir's user avatar
3 votes
2 answers
118 views

Using PHP goto Labels for code folding

I've been using PHP labels in my Controllers for code folding. PHP labels are actually used with goto statements. But I'm using labels only because it's so much ...
Mukarram Khalid's user avatar
3 votes
1 answer
843 views

Table rendering helper

I wrote this little helper to render a table, however, working with nested content_tag is messy. ...
just so's user avatar
  • 237
3 votes
1 answer
199 views

PHP RESTful API for a student repository

All of the codes are based on the PSR-2 standard. Also Dependency-Injection and Repository patterns are followed. I would love to hear some advices or comments. StudentRepository Class ...
MeteHan's user avatar
  • 350
2 votes
1 answer
4k views

Global site settings middleware for Slim Framework 3

I have created this middleware code for slim. I just want to know that is this right way to store site settings globally. so, I can use where ever I want. What do you think about my class structure ...
Erdem Ece's user avatar
  • 209
1 vote
1 answer
80 views

Restful resource with pagination and additional mapping

I have this script that i use to get all clients with their events, main thing here is that i need to return all clients that have some events in specific periods and also i need to show clients that ...
Sahbaz's user avatar
  • 341
1 vote
2 answers
172 views

PHP - How can I refactor this store function (which handles different database operation for user types) in order to reduce duplication?

I'm simply using Slim PHP MVC framework in my API project. PDO::FETCH_ASSOC is used in the database calls. So no data objects. The router handles requests and pass to the controller. controller calls ...
camille's user avatar
  • 147
1 vote
1 answer
182 views

Is this an good OOP Design in MVC PHP for getting User Details?

I was given a API project by my co-worker to work on half created a system in slim PHP. The project consists of the Models and controllers. When the route is called it calls the Controller with the ...
camille's user avatar
  • 147
1 vote
2 answers
70 views

Form validation for user account creation

What would be a cleaner way to write the following? ...
Joe Scotto's user avatar
1 vote
1 answer
259 views

Secure login and authentication in PHP

This seems to work for me, but I want to make it more secure. I want to see how far I can go without pre-built packages/bundles, so please don't suggest any. How secure is this? What are some steps I ...
twharmon's user avatar
  • 303
1 vote
0 answers
549 views

Implement versioning of a RESTful API with PHP/Slim and Apache

I want to create a RESTful API with Apache/PHP and the Slim Framework (3.x). The API should support URI-based versioning like ...
CachingFoX's user avatar
1 vote
0 answers
727 views

MVC architecture for a Slim application

(https://github.com/trvshrmn/slim) This is more of an entire project review... if this is 'off topic' I apologize. I attempted to make Slim into an mvc structure. I added a few controllers, views and ...
twharmon's user avatar
  • 303
0 votes
2 answers
124 views

Paginated method to get all items

I'm using slim php and i have this simple paginated end point to get all clients, i feel like i could do some things here better, so i would appreciate all suggestions, if possible please give me code ...
Sahbaz's user avatar
  • 341
0 votes
1 answer
3k views

Slim 3 dynamic middleware code optimisation

Recently I started playing a bit with Slim and what is making me confused is a necessity of container and middlewares hard coding. As because I am a staunch supporter of a dynamic loading I decided ...
user3555602's user avatar
0 votes
1 answer
33 views

Is there any better / improved / optimise way to approach these input checker? [closed]

Actually I got a form with multiple input (around 39) on which I wish to perform some check and display customs messages based on sets of conditions. I found a way to address my problem but I'm ...
Matthias's user avatar
0 votes
1 answer
684 views

MVC Auth Structure and Dependency Injection with PHP-DI 5 and Slim 3

I'm creating an authentication with the Slim 3 framework and PHP-DI 5 (PHP-DI/PHP-DI). The project will be the base/starter template for my new projects. I want it to be easy to extend, also to ...
Ramon Bakker's user avatar
0 votes
1 answer
106 views

Initial stages of MVP, is the bootstrap file efficient coding

I am attempting to put my new OOP skills to the test and am eventually going to build a simple OOP login/registration system. However as I am making use of OOP I have decided to make my own simple ...
mp252's user avatar
  • 497
0 votes
1 answer
1k views

PHP OOP MVC Project Structure

I'm a beginner in OOP and PHP frameworks. I used slim skeleton to create a project and designed the project in this way. Project structure is given by the slim skeleton. Object Mappers are added by ...
Tharindu's user avatar
  • 133