Pull row from database corressponding to url route


#1

I know I probably butchered the wording of the title, but what I want is to get a row from my database that corresponds with the url routing thing that slim does, ex: ‘www.mysite.com/pages/1’ i want to return row one of the table - ‘www.mysite.com/pages/57’ would return row 57 of the table. I know practically no slim so the more detail and dumb talk you can provide the better. Thanks.

If this is possible, how would I use the output to fill a page? I was told that I could use twig templates to do this, but don’t really know how.

If this is too much info and no one want to spend the effort typing out how all this stuff works, just a point in the right direction tutorial/learning wise would be much appreciated, ive been trying to google this stuff on my own for some 20 hours this weekend and keep failing. thank you.


#2

Welcome @Rareform

For the beginning I would like to recommend you some Slim Framework resources and tutorials:

Please read the Slim Documentation first:

Also learn the basics about PSR-7, Routing and DI.

Then try to create the first Slim application:

Good luck :slight_smile:


#3

Ok ill take a look at the links thanks so much!