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

Поділитися
Вставка

КОМЕНТАРІ • 120

  • @stocothedude
    @stocothedude Рік тому +19

    This is how I got a great job as a web dev, two years ago. I wrote my own framework for practice and was able to pass the interview and assignments later 😊👍🏽

    • @GaryClarkeTech
      @GaryClarkeTech  Рік тому +1

      You did the right thing...nice work!

    • @vicentsimon319
      @vicentsimon319 Рік тому +3

      Did so myself. And I must say, it allowed me to understand PHP and web processes on a deeper level.

    • @GaryClarkeTech
      @GaryClarkeTech  Рік тому

      @@vicentsimon319 Love that

  • @fa6805
    @fa6805 Рік тому +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.

  • @holonaut
    @holonaut 6 місяців тому +3

    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  6 місяців тому

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

  • @JACKoPL
    @JACKoPL 15 днів тому +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.

  • @bijayaprasadkuikel5162
    @bijayaprasadkuikel5162 Рік тому +1

    Frankly speaking this video needs millions of views.

    • @GaryClarkeTech
      @GaryClarkeTech  Рік тому

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

  • @theJohnCode
    @theJohnCode 10 місяців тому +1

    So happy i found this channel today

    • @GaryClarkeTech
      @GaryClarkeTech  10 місяців тому +1

      Welcome aboard!

    • @theJohnCode
      @theJohnCode 10 місяців тому

      Thank you sir, following you on X @@GaryClarkeTech

  • @user-xv4fb5wz9i
    @user-xv4fb5wz9i 5 місяців тому +1

    Thank you for the detailed video. The approach is truly modern and not the standard MVC crab that one usually finds on UA-cam. 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  5 місяців тому

      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.

  • @nikimendosa3823
    @nikimendosa3823 Рік тому +1

    I'm from Russia. Thanks for video!

  • @JeffLewis1975
    @JeffLewis1975 27 днів тому

    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 дні тому

      Yep..all my courses receive updates after release

  • @rightscript3266
    @rightscript3266 6 місяців тому

    Thanks Gary. I always enjoy your talks and examples.

  • @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?

  • @TheRcfrias
    @TheRcfrias 5 місяців тому +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  5 місяців тому

      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!

  • @user-su1dw3vw8t
    @user-su1dw3vw8t Рік тому +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

    • @user-su1dw3vw8t
      @user-su1dw3vw8t Рік тому

      @@GaryClarkeTech Looking forward for May 2nd!

  • @Fshhady
    @Fshhady 5 місяців тому

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

    • @GaryClarkeTech
      @GaryClarkeTech  5 місяців тому

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

  • @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

  • @devhenry9054
    @devhenry9054 8 місяців тому

    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  8 місяців тому

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

  • @scott-richardson
    @scott-richardson 2 місяці тому

    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  2 місяці тому +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 2 місяці тому

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

  • @AlwinAugustin
    @AlwinAugustin Рік тому

    Great work !! waiting for next videos !!

  • @mohammedb7538
    @mohammedb7538 Рік тому +1

    Great, beautiful work🤓

  • @mamadoualysy3708
    @mamadoualysy3708 Рік тому

    Thanks for your time we appreciate it

  • @mdazhardware
    @mdazhardware Рік тому

    Interesting tutorial, thanks for all.

  • @beticohernandez9536
    @beticohernandez9536 2 місяці тому

    Excelente

  • @RuslanKrietsu
    @RuslanKrietsu 10 місяців тому

    Thank you for this very important video.

    • @GaryClarkeTech
      @GaryClarkeTech  10 місяців тому

      You're welcome..thanks for watching

  • @kennedymuthui8835
    @kennedymuthui8835 Рік тому

    Nice course

  • @lwa.dev74
    @lwa.dev74 Рік тому

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

  • @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!

  • @gman8361
    @gman8361 5 місяців тому

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

    • @GaryClarkeTech
      @GaryClarkeTech  5 місяців тому

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

  • @AlianVesuf
    @AlianVesuf Рік тому

    Great work. Thank you sir

  • @nadetdevfullstack7041
    @nadetdevfullstack7041 10 місяців тому

    Excellent !

  • @danio0227
    @danio0227 28 днів тому

    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

  • @user-ys3uu5un6l
    @user-ys3uu5un6l Рік тому

    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

  • @nbizzle
    @nbizzle Рік тому

    Great video! Thanks so much!

  • @joshdevofficial
    @joshdevofficial 2 місяці тому

    is this works only with docker? or not?

    • @GaryClarkeTech
      @GaryClarkeTech  2 місяці тому

      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

  • @_chris_6786
    @_chris_6786 11 місяців тому +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  11 місяців тому +1

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

    • @_chris_6786
      @_chris_6786 11 місяців тому

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

  • @eritech
    @eritech Рік тому +1

    I would buy but it's a bit expensive

  • @mairahs16
    @mairahs16 Рік тому

    amazing !!!!! Thank you very much

  • @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

  • @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

  • @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.👍

  • @ddobren
    @ddobren Рік тому +1

    Add middlewares

  • @omarabdelwahhab30
    @omarabdelwahhab30 11 місяців тому

    How can I get a coupon for this course ?

    • @GaryClarkeTech
      @GaryClarkeTech  11 місяців тому

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

  • @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 )

  • @alphayowakarindi
    @alphayowakarindi Рік тому

    You rock!

  • @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.

  • @houssemrahrah2358
    @houssemrahrah2358 Рік тому

    great work

  • @rjtech.gaming
    @rjtech.gaming Рік тому

    how to return a file like the view in laravel

  • @AtomTCP
    @AtomTCP Рік тому

    thanks you siiiiir

  • @lwa.dev74
    @lwa.dev74 Рік тому

    lol just realised its PhpStorm :-)

  • @paultoma
    @paultoma Рік тому

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

  • @lwa.dev74
    @lwa.dev74 Рік тому

    Subbs!!! to the channel BTW

  • @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.💗