PHP Framework Pro (Create a PHP framework step by step)

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025

Комментарии •

  • @holonaut
    @holonaut 10 месяцев назад +4

    Within the first 2 minutes I can already say this is some very high quality content, straight to the point. But the music is wildly distracting. I wish there was a version without the music

    • @GaryClarkeTech
      @GaryClarkeTech  10 месяцев назад

      Yeah the music was a mistake! I actually removed it for the full course cos someone else also said it sucked 😂

  • @youaskforit
    @youaskforit Год назад +2

    I saw several php framework from scratch videos like this and so far only this one and from the laracast channel have the most professional way to do it. Others are still doing the old ways where the URI segments are broken down to controller, method, params, etc which are not bad for a beginner but not for real world web apps. This is the way it should be done. Thanks for the video. Saved it to my playlist to keep as refresher.

  • @bijayaprasadkuikel5162
    @bijayaprasadkuikel5162 Год назад +1

    Frankly speaking this video needs millions of views.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      Ah thanks a lot...I appreciate the kind words!

  • @golden_azubuike
    @golden_azubuike 2 месяца назад

    A great content you have here. THis is worth hundreds of dollars. Thanks a lot Gary

  • @JACKoPL
    @JACKoPL 4 месяца назад +1

    Finally I found more modern and professional material about my own mvc/framework. From what I see, it doesn't take much to adapt routes like in laravel / Route::get() /. Nevertheless, it would be useful to have material about the view for this framework like Blade and Eloquent :D Maybe there will be another film after 18 months.

  • @truthteachers
    @truthteachers Год назад +2

    Hi Gary, at timestamp 44:23, you are using "REQUEST_URI". I found that there are instances where this parameter may not be available. How is that handled?

  • @theJohnCode
    @theJohnCode Год назад +1

    So happy i found this channel today

  • @rightscript3266
    @rightscript3266 10 месяцев назад

    Thanks Gary. I always enjoy your talks and examples.

  • @ozaninioliveira
    @ozaninioliveira Год назад +2

    1:09:00 - Why not just spreading the $vars as parameter of the controller method? "(new $controller())->$method(...$vars)"

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад +1

      Good question...the handler might not be a controller object, later on I also make it possible to use an inline function in the web.php file.
      In addition to that, I later also use the container to resolve and autowire controllers...but spreading would still work with that.
      A lot of answers come later as the course progresses

    • @ozaninioliveira
      @ozaninioliveira Год назад

      @@GaryClarkeTech Looking forward for May 2nd!

  • @JeffLewis1975
    @JeffLewis1975 4 месяца назад

    Starting to watch this but was wondering if the course on the site gets updated. Was thinking of buying it and wanted to make sure things are updated.

    • @GaryClarkeTech
      @GaryClarkeTech  3 месяца назад +1

      Yep..all my courses receive updates after release

  • @BetterCallAdmin
    @BetterCallAdmin 9 месяцев назад +1

    Thank you for the detailed video. The approach is truly modern and not the standard MVC crab that one usually finds on RUclips. I will purchase the course to incorporate your explanations of the code. Are you planning to write a router completely from scratch in the future and make a video about it?

    • @GaryClarkeTech
      @GaryClarkeTech  9 месяцев назад

      You're welcome..I'm sure you'll enjoy the full course. Creating a production grade router from scratch is a pretty tall order...I'd have to think about it. Even the ones that you think have been build from scratch use Fastroute under the hood.

  • @kevinkabeya2459
    @kevinkabeya2459 Год назад

    Great content very clear and has helped me better understand the inner workings of PHP framework! I am now off to learn CakePHP

  • @scott-richardson
    @scott-richardson 6 месяцев назад

    What's the performance difference between running this kernel/router in PHP versus just having your routes in .htaccess? Is there a point in which the request is handled faster in one or the other?

    • @GaryClarkeTech
      @GaryClarkeTech  5 месяцев назад +1

      I don't know about performance but the php router is used to direct the request to the appropriate request handler...which is also php code. It would only be possible to do that using .htaccess by directing to different php files (I think)..which means you'd lose your single point of entry, amongst other things

    • @scott-richardson
      @scott-richardson 5 месяцев назад

      @@GaryClarkeTech I have implemented a new php router since watching this video and I see zero issues with performance.

  • @TheRcfrias
    @TheRcfrias 9 месяцев назад +1

    Hey Gary!, what is your opinion about a framework named "Slim Framework"? Is this somenthing related to what you explain in this list of videos?

    • @GaryClarkeTech
      @GaryClarkeTech  9 месяцев назад

      It's great..I'm using it in PHP API Pro (www.garyclarke.tech/p/php-api-pro)
      Highly recommended to anyone learning because it helps you get a good understanding of PSR and all the framework components because it's much smaller and lighter then behemoths like Symfony and Laravel
      Give it a try!

  • @_chris_6786
    @_chris_6786 Год назад +1

    Hello Gary.
    In the minute 46:00 you create this structure that is like an array but reverted:
    [$status, $handler, $vars] = $routeInfo;
    What is the name of this structure?
    I've searched "assign array to variable" but nothing is shown.
    Can you (or someone) point me to the right direction please?
    Thank you.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад +1

      This is called array destructuring...or list unpacking if you're old skool

    • @_chris_6786
      @_chris_6786 Год назад

      Thanks a lot Mr. Gary, is more clear now 💪🏻

  • @devhenry9054
    @devhenry9054 11 месяцев назад

    I love your this short mvc framework tutorial. Want to learn more from your framework course. Can you publish that mvc framework course in udemy?

    • @GaryClarkeTech
      @GaryClarkeTech  11 месяцев назад

      I don't use Udemy but you can find the full course at my site:
      www.garyclarke.tech/p/php-framework-pro

  • @truthteachers
    @truthteachers Год назад

    Hi Gary, the code at timestamp 1:11:07 should not work as the call_user_func_array is passing an array but the show method is still typed as int. I am getting the same error. Additionally, $vars contains a string for "id" and not an int.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      It should still work like mine. The $vars array contains the same number of items as the method signature so they will just be mapped. Also PHP will try to cast strings to ints if an int is type-hinted by the method...this will work if the string can be cast to an int i.e. it is a string containing whole numbers only.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад +1

      Having thought about it, could it be possible that you're declaring strict types somewhere where I'm not?

    • @truthteachers
      @truthteachers Год назад +1

      @@GaryClarkeTech Yes i declared strict types in all my scripts. I removed it and it worked fine but do not feel good about it. The regex declared as digits but what is transmitted is string. I guess that how http get works. Thank you for clarifying.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      @@truthteachers Cool..glad you got it working. Personally I think it's fine to relax on the strict types declaration in controllers cos it's very common to receive data in string format that you wish to cast to ints. It's all a trade-off! Controllers are a fairly unique part of the puzzle

    • @truthteachers
      @truthteachers Год назад

      Bought your full course. Thank you for the discount coupon.👍

  • @danio0227
    @danio0227 4 месяца назад

    Hello, I am having problems purchasing your course. Is it still available?
    Specifically, I have a problem with the payment gateway.

    • @GaryClarkeTech
      @GaryClarkeTech  3 месяца назад

      Email info@garyclarke.tech and we'll try to help ya

  • @nikimendosa3823
    @nikimendosa3823 Год назад +1

    I'm from Russia. Thanks for video!

  • @Fshhady
    @Fshhady 9 месяцев назад

    It's great Gary
    Can you please implement Middleware, Authentication and Authorization.
    Bunch of thanks

    • @GaryClarkeTech
      @GaryClarkeTech  9 месяцев назад

      Yes that's all included in the full course
      www.garyclarke.tech/p/php-framework-pro

  • @joshdevofficial
    @joshdevofficial 6 месяцев назад

    is this works only with docker? or not?

    • @GaryClarkeTech
      @GaryClarkeTech  5 месяцев назад

      It works with anything. Using my Docker setup is just a recommendation..it means the student will have the same setup as me.

  • @truthteachers
    @truthteachers Год назад

    Hi Gary, when i install FastRoute it installs Version 1.3 and not 2.0. Is there something wrong?

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад +1

      I'm gonna say either your php version..that might be unlikely though cos v2 just requires 7.4 or it could be your minimum-stability setting. By default this will be stable unless specified otherwise in your composer.json. To use the dev-master of fastroute your minimum-stability would need to be dev
      Just check my setting in the repo to see how your compare:
      github.com/GaryClarke/php-framework-pro

    • @truthteachers
      @truthteachers Год назад

      @@GaryClarkeTech Yep, got it. Thank you so much. Just a note that github code does not appear to be for this video course

  • @gman8361
    @gman8361 9 месяцев назад

    FastRoute simpleDispatcher is deprecated and the documentation doesn't have any other method to use in its place that isn't deprecated.

    • @GaryClarkeTech
      @GaryClarkeTech  9 месяцев назад

      Yes..very strange. Just use version 1.3 to work along with this.

  • @mohammedb7538
    @mohammedb7538 Год назад +1

    Great, beautiful work🤓

  • @mamadoualysy3708
    @mamadoualysy3708 Год назад

    Thanks for your time we appreciate it

  • @lwa.dev74
    @lwa.dev74 Год назад

    Hi Gary, what software are you using? is there anything specific which is needed? cheers :-)

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      Just PHP and an editor / IDE is all you need

  • @RuslanKrietsu
    @RuslanKrietsu Год назад

    Thank you for this very important video.

  • @alwinaugustin
    @alwinaugustin Год назад

    Great work !! waiting for next videos !!

  • @lahoucineoldakdim7778
    @lahoucineoldakdim7778 Год назад

    What about support middleware how to implement into Router!!!

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      That's done in the full course. An entire chapter on middleware in fact

  • @hamadadel1947
    @hamadadel1947 Год назад +1

    Thanks, awesome work, can I use this framework for production?

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      Yes, you can but I'd recommend swapping the Request / Response classes for Symfony HttpFoundation ones...that's why I used the same public API...easy substitution.
      I'll include some recommendations at the end of the full course for production use.

    • @atomeksss
      @atomeksss Год назад

      Hi, maybe you'll add some examples on how to use MySQL db, user authentication, registration, maybe some email sending, reCAPTCHA with this framework?

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад +1

      @@atomeksss DB will be agnostic, using a DB abstraction layer, auth yes, registration likely, email..dunno, recaptcha don't think so ..other priorities. Good suggestions

    • @atomeksss
      @atomeksss Год назад

      @@GaryClarkeTech Thanks for the reply. Today I realised of more important things. Like title, meta-description, breadcrumbs and how to output some alert.. Like, 'thank you for your registration' message. Ofc you can simply redirect user to another page, but you're not going to redirect users after every form submit on site... Sometimes you just wanna add a message below breadcrumbs. Anyways, thanks for the knowledge and will be waiting for the course! Yes, registration can be just a few words about... Maybe it's not necessary to show exactly how it's done.

    • @atomeksss
      @atomeksss Год назад

      Actually, two more topics for your consideration: views (but I think you'll cover that... Also all these things like title, meta-description, breadcrumbs and how to output some alert are in the view topic if I'm correct) and file uploads, thanks!

  • @omarabdelwahhab30
    @omarabdelwahhab30 Год назад

    How can I get a coupon for this course ?

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      I do discounts for subscribers. There are sign up boxes on the course page
      www.garyclarke.tech/p/php-framework-pro

  • @paradisia4494
    @paradisia4494 Год назад

    thanks for this but you lost me a little bit when introcing the rooter because you use the already built Fst routing component and i did not understand how rooting works... anyway of you can do everything fro, scrash the should be good to understand

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      I used FastRoute mainly for its handling of regex and splitting of paths. I still needed to do some work to match those paths to handlers so that's why I created my router class. The league/route library also does this as FastRoute alone does not suffice

  • @rjtech.gaming
    @rjtech.gaming Год назад

    how to return a file like the view in laravel

  • @mdazhardware
    @mdazhardware Год назад

    Interesting tutorial, thanks for all.

  • @ЕвгенийБатулин-г9з

    Thank you for your lessons. How can I contact you to ask questions about the course?

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      Thanks for watching.
      You can email info@garyclarke.tech or message me on Twitter / LinkedIn

  • @nadetdevfullstack7041
    @nadetdevfullstack7041 Год назад

    Excellent !

  • @nbizzle
    @nbizzle Год назад

    Great video! Thanks so much!

  • @AlianVesuf
    @AlianVesuf Год назад

    Great work. Thank you sir

  • @kennedymuthui8835
    @kennedymuthui8835 Год назад

    Nice course

  • @mairahs16
    @mairahs16 Год назад

    amazing !!!!! Thank you very much

  • @beticohernandez9536
    @beticohernandez9536 6 месяцев назад

    Excelente

  • @tech-roast-ai
    @tech-roast-ai Год назад +1

    I would buy but it's a bit expensive

  • @houssemrahrah2358
    @houssemrahrah2358 Год назад

    great work

  • @alphayowakarindi
    @alphayowakarindi Год назад

    You rock!

  • @paultoma
    @paultoma Год назад

    Thank you very much! Appreciate a lot your hard work!

  • @ddobren
    @ddobren Год назад +1

    Add middlewares

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      Added in the full course

    • @TheHsystem
      @TheHsystem 2 месяца назад

      Question: is there a difference between the $kernel and the middleware? Since the $kernel handles incoming requests as the middleware is supposed to do.

  • @alionides
    @alionides Год назад

    Thanks for great tutotial. It would be nice if you added Models and templating such as blade or twig to be complete MVC framework. I hope you will add this later.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад +1

      Yes both of those get added. I build a complete framework...you can check the contents here:
      www.garyclarke.tech/p/php-framework-pro

    • @alionides
      @alionides Год назад

      @@GaryClarkeTech great thanks )

  • @AtomTCP
    @AtomTCP Год назад

    thanks you siiiiir

  • @lwa.dev74
    @lwa.dev74 Год назад

    lol just realised its PhpStorm :-)

  • @lwa.dev74
    @lwa.dev74 Год назад

    Subbs!!! to the channel BTW

  • @truthteachers
    @truthteachers Год назад

    Looks like the course may be more aligned to symfony framework which is used by Laravel as well.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад +1

      I've recreated some of my fave parts from both. There are occasions where I prefer how one framework handles things. I also consider which way of doing things would be the easiest to teach.

  • @truthteachers
    @truthteachers Год назад

    Hi Gary, nice job. In the description you gave us the link for the full course but when i clicked the link i just got into you website but not the full course. Advise please. Additionally, many of us dont like using additional components/tools like Docker. We would like to stick to basics that way Docker can die for all we care. We want to use XAMPP because that deployment to CPanel will be straight forward.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      Cheers Mani..the link for the full course is here: www.garyclarke.tech/p/php-framework-pro
      I used Docker here because I only have to share one file with you and you run one command and have the same setup as me on any operating system. But if you have a setup that you are comfortable with then defo stick with that. Your commands will be the same, minus docker compose exec app

    • @truthteachers
      @truthteachers Год назад

      @@GaryClarkeTech Hi Gary, The link still does not provide the full course. All it does is show description and codes in text form. there is no videos there. Is that what it is meant to be?
      Tq for the advise on Docker. I figured out that too. The only thing is the image part. Do do not understand that.

    • @GaryClarkeTech
      @GaryClarkeTech  Год назад

      @@truthteachers The full course will be released in March and you'll be able to enroll on that same page. There are some sample videos at the bottom and I'll add some more there in a few days.

    • @truthteachers
      @truthteachers Год назад

      @@GaryClarkeTech Thank you so much.💗