PHP For Beginners, Ep 33 - Build a Better PHP Router

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Thanks for the lesson. I didn't understand what really happens behind the scenes in Laravel and now I do 😊

VideoDarslar
Автор

Amazing didatics as always (i'll say it again, even for us that already use the language for long time)...
I'd just add constants in Router class for each method, because it bother's me using "magic strings" even if its used once.

DougLopes
Автор

i have a filing that this series will end up with laravel as final result

hugo-abdou
Автор

Great how you explain it step by step. I love it.
The method add is public, but on that point it could be private like the variable routes, couldn't it?

michaellamas
Автор

Cool thing will be later to show how {param} variables can be appended to routes

andreymikhalev
Автор

Thanks for awesome tutorials
I learn a lot about core php
👌👌👌

davidasadi
Автор

this episode is a little hard, but amazing

AKYY
Автор

I have written all the routes using the router->get() syntax, but only the top 1 is getting rendered rest all are showing Error404.php page 😢. Can somebody help me?

notnotkeshav
Автор

Hi, great video.
One thing that i do not understand is how in note route route ( show route) , the URI match ?
since that route has a query string, which query string is in URI should not match.

Another thing, i think that in first version of this series, at root of routes array you create the methods as keys and associate the respective route ( uri + controller) to method key, so you had assoc array instead of index array that you have now in this new series.

And why not use preg_match?

jediampm
Автор

used this code with IIS Server with web.config file to send each file to public/index.php
but could not load the static files like .js, .css and images
can you guide

ajaybagdia
Автор

Hi @Laracastsofficial how do you handle the routes for images inside the uploads folder? It always goes to 404 even on direct URL. Or even CSS/JS folder so I can add it dynamically on my routes.

marcrebadina
Автор

Why wont use URI as $routes array key in order not to cycle the $routes array for finding the matching REQUEST URI?

gherosh
Автор

Anyone knows what theme Jeffey is using here? I tried Googling, but only found the old theme in Laracasts.

DaviMartins
Автор

is there a way to get the code of this video??

martinmata
Автор

Hey Jeffrey, is the source code available?

lserranoit
Автор

I tried a lot on your routers but these are not working, even on real website i tried to implement it not working.

Dev.Waleed
Автор

Your routers way isn't working . I tried a lot but getting in trouble each time. I also tried to implement it on real hosted website to analyze either may be something wrong with my virtual php environment but still it's not been working.

Dev.Waleed
Автор

Is anyone still monitoring this playlist? Everything has worked great until this video. The new routing system has broken everything and nothing works.

johnnybrunerdesigns
Автор

In order to actually save a new note and to delete a note, routes.php should be

$router->get('/', 'controllers/index.php');
$router->get('/about', 'controllers/about.php');
$router->get('/contact', 'controllers/contact.php');

$router->get('/notes',
$router->get('/note',
$router->get('/notes/create',
// Jeffrey forgot these last two routes
$router->post('/notes/create', 'controllers/notes/create.php');
$router->delete('/note', 'controllers/notes/show.php');

paulbrugger