Routing, Controllers, Views - Part 1 | PHP MVC Framework from Scratch

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 396

  • @TheCodeholic
    @TheCodeholic  2 ปีที่แล้ว +27

    If you have the following error at 56:55
    call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method app\controllers\SiteController::handleContact() cannot be called statically
    You have to make some changes in Router class. During the time of making this framework PHP version was allowing calling non-static method statically, but later it was changed.
    Here is fix...
    At 31:07 instead of calling call_user_func($callback) directly, we need to create an instance of the controller first.
    if (is_array($callback)) {
    $callback[0] = new $callback[0];
    }
    return call_user_func($callback);

    • @TheCodeholic
      @TheCodeholic  2 ปีที่แล้ว

      Does your controller have correct namespace?
      Try to put \ in front of app\controller\SiteController

    • @TheCodeholic
      @TheCodeholic  2 ปีที่แล้ว

      @Đinh Như Khang I mean in index.php

    • @TheCodeholic
      @TheCodeholic  2 ปีที่แล้ว

      You have something wrong in either index.php or in SiteController

    • @blessdarah1256
      @blessdarah1256 2 ปีที่แล้ว

      @Đinh Như Khang I also have this type of problem. The temporal solution was to make the function in the controller static. I'm stilling looking of a good fix to work without having to make all controller functions static.

    • @blessdarah1256
      @blessdarah1256 2 ปีที่แล้ว +1

      This solution works perfectly fine. Tested and it's working.

  • @tutanchacon
    @tutanchacon ปีที่แล้ว +8

    Three years later, it remains a great contribution to the community!
    Thanks for all

  • @Gorbatsjov27
    @Gorbatsjov27 4 ปีที่แล้ว +12

    Never worked with a (MVC) framework in my life and your explaination is super clear and easy to comprehend. You have a gift to do this. Keep doing this please.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +1

      Huge thanks man. APPRECIATE

    • @m3awna
      @m3awna 4 ปีที่แล้ว

      how long have you been a developer?

    • @Gorbatsjov27
      @Gorbatsjov27 4 ปีที่แล้ว +1

      @@m3awna I'm not a developer. At least not professional. In my spare time I'd like to program. And I did that on and off for the last 20 odd years. Mostly HTML and CSS, a bit of PHP and even less JS.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +1

      @@m3awna I started coding 10 years ago and it's almost 9 years I work as a developer.

    • @m3awna
      @m3awna 4 ปีที่แล้ว +1

      @@TheCodeholic we entered this field around the same time, but you're doing a lot better than me :) thanks for the tuts

  • @mohammadaminsamadi9341
    @mohammadaminsamadi9341 3 ปีที่แล้ว +3

    i think this is the best php tutorial for building MVC FRAMEWORK

  • @HondoUS
    @HondoUS 2 ปีที่แล้ว +3

    Just finished Part 1. I really learned quite a bit.
    Some constructive feedback:
    - Maybe breaking the video down into shorter parts. There were a few points where I felt the video could have ended and a new one started.
    - For those not using PHPStorm, maybe clarifying when PHPStorm automagically adds something.
    - Maybe a little less jumping around; can be confusing for novices.
    Great job and extremely thorough explanation! Thank you!

  • @azatnurzhanuly7290
    @azatnurzhanuly7290 4 ปีที่แล้ว +2

    Thank you, I did not even need to increase the playback speed because the narration is on point!

  • @stms999
    @stms999 3 ปีที่แล้ว +8

    I am a beginner so I can't judge others' code but I know clean code when I look at one. Readable, organized and it's only the first video. Fantastic work!!

  • @amirulfitri3751
    @amirulfitri3751 4 ปีที่แล้ว +3

    Y u didn't have more viewssss! Just discovered your channel and immediately subscribed. Please continue the hard work, you're amazing.

  • @Akosiyawin
    @Akosiyawin 4 ปีที่แล้ว +3

    Holy macaroni, I also created my own framework which is similar to your routing approach, But this is entirely more creative and object oriented, I might as well try this and re write my code. Thanks for this, God Bless you!

  • @LEXUANPHAT
    @LEXUANPHAT ปีที่แล้ว +1

    Hello,
    I'm Vietnamese, I've watched your video and I see your video is very good, there's a lot of PHP stuff that I don't know yet.

  • @lanreoreyomi9555
    @lanreoreyomi9555 4 ปีที่แล้ว +7

    This is crazy amazing. I never knew PHP was this cool. Thank you. Thank youuuuuuuuuuuuuuu

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +3

      You're very welcome! PHP is very cool language.

    • @lanreoreyomi9555
      @lanreoreyomi9555 4 ปีที่แล้ว

      @@TheCodeholic Thank you. Do you offer mentorship? That's one thing I am missing in my career development

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Do you mean one to one teaching?

    • @lanreoreyomi9555
      @lanreoreyomi9555 4 ปีที่แล้ว

      @@TheCodeholic not really. It's someone you reach out to for some career advice. Share development process and also, help you become a better developer.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +4

      I do this for junior developers in my company. And I plan to express this on my youtube channel.

  • @jakubgadzala7474
    @jakubgadzala7474 3 ปีที่แล้ว +3

    Thank you for your hard work sir! This could definetely be a paid course. One more time, hats off to you sir, and a million thanks.

    • @TheCodeholic
      @TheCodeholic  3 ปีที่แล้ว +1

      Thanks buddy.
      It means a lot for me.

    • @jakubgadzala7474
      @jakubgadzala7474 3 ปีที่แล้ว

      @@TheCodeholic I have finished your course on Traversy Media, and now started this one. It helps a lot. Never seen anybody iterating over one subject like you do. It's simply amazing. I would love to become your acolyte and work for you on daily basis

  • @dungaland
    @dungaland 4 ปีที่แล้ว +4

    Lots of thanks. Is something i have been looking for for years

  • @ilya_123__
    @ilya_123__ 10 หลายเดือนก่อน

    Thank you a lot!. After 3 times i watched and workout this lesson i begin to understand! Lets go ahead! Your lessons is great!

  • @neilacero6761
    @neilacero6761 4 ปีที่แล้ว +2

    I knew that accent sounded familiar, and then the surname appears! Great tutorial. Madloba!

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Thanks buddy.
      Shenc madloba 😉

  • @neutralengineer3873
    @neutralengineer3873 3 ปีที่แล้ว +1

    Hats off ❤️❤️❤️
    Love from 🇮🇳 India.

  • @홍성남-m3q
    @홍성남-m3q 4 ปีที่แล้ว +2

    You are really a genius.
    I want to give you thumbs-up as many as I can.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +2

      Thank you buddy.
      However I am not a genious at all. I am just very hard working person and this framework show also this.
      I did it 3 times to finally create video on it.
      But thanks once again...
      Appreciate your feedback...

  • @arturobatista8015
    @arturobatista8015 3 ปีที่แล้ว +1

    i am not an english speaker but i learned so much with this video, thanks :D.

  • @terrymurray2076
    @terrymurray2076 4 ปีที่แล้ว +9

    Excellent Job! You mentioned that this framework is for educational purposes only. I was wondering what has to be done to make it suitable for production.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +7

      It needs to be tested, bug fixed and improved for next several months only after that I would say it would be ready for production

    • @_zetrax
      @_zetrax 4 ปีที่แล้ว +7

      @@TheCodeholic Can you make a video on how to test and bug fix software for production development. BTW, nice video.

  • @rashadmammadov8201
    @rashadmammadov8201 ปีที่แล้ว

    it is a gold material thanks for sharing it on youtube for free you are great man

  • @rajeshbudhathoki7888
    @rajeshbudhathoki7888 4 ปีที่แล้ว +2

    Wow!😍😍 Thank you millions for making the series! 🙏🙏

  • @sevdinkojic6212
    @sevdinkojic6212 4 ปีที่แล้ว +5

    Very good approach with the evolution step by step ans very well explained, you did a great job congratulation and i hope that you have the courage to continue like this because it's lot of work. Thank you for sharing your knowledge with the community, i follow and and gonna share your channel !!!

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Huge thanks Sevdin. Such comments are what I am doing all this for. The more such comments I see the bigger will be my motivation.

  • @mrtayyabmughal7209
    @mrtayyabmughal7209 4 ปีที่แล้ว +10

    Excellent, thanks, please make lectures on Laravel framework, if you have time 👍

    • @moazamali2434
      @moazamali2434 4 ปีที่แล้ว +1

      Ya i am too looking forward for that

  • @mouhamaddiop1144
    @mouhamaddiop1144 4 ปีที่แล้ว +2

    The way you code is very nice and understandable. Thanks a lot

  • @mehdielfatihi9459
    @mehdielfatihi9459 4 ปีที่แล้ว +3

    thank you very much , building an MVC framework is an awesome way to help people understand how real Frameworks like laravel works under the hood , keep going bro I just start learning backend development .

  • @yves2522
    @yves2522 2 ปีที่แล้ว +1

    Your're a great developer and...a very good teacher. Thanks a lot for sharing so much knowledge! It saved me weeks of reading and testing ;-)

  • @kadirookirim3231
    @kadirookirim3231 3 ปีที่แล้ว

    thank you, i think this is the best php tutorial for building MVC FRAMEWORK

  • @saadnasim3032
    @saadnasim3032 11 หลายเดือนก่อน

    you deserve a subscribe ... Thankyou for this amazing tutorial

  • @bicancezar-catalin3402
    @bicancezar-catalin3402 3 ปีที่แล้ว +2

    It's amazing the way you explain, thank you for this tutorials and for the time spent in creating this piece of art.

  • @Lucas-hh4oh
    @Lucas-hh4oh 3 ปีที่แล้ว +1

    Hey, thanks for the tutorials! Its really give me deep insight on how most of the framework actually work!

  • @dccastro2182
    @dccastro2182 4 ปีที่แล้ว +1

    Porra !! Eu esperei por este conteúdo há muito tempo, e agora chegou na minha cara!!

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +1

      Excellent!!! Hope it will teach you something.

  • @fatihkara6411
    @fatihkara6411 3 ปีที่แล้ว +1

    thank you very much from Turkey

    • @TheCodeholic
      @TheCodeholic  3 ปีที่แล้ว

      You are welcome from Georgia.

  • @mohammadtaheri98
    @mohammadtaheri98 4 ปีที่แล้ว +2

    good job man, everything in order. very clear and perfect

  • @renrevz8140
    @renrevz8140 2 ปีที่แล้ว

    It was never too late to learn again Thank you so much for the absolute tutorial you have been making❤️❤️ keep up the good work

  • @coderboysobuj
    @coderboysobuj 4 ปีที่แล้ว +4

    It’s really great tutorial. Go ahead sir..❤❤

  • @arnavchandra
    @arnavchandra 4 ปีที่แล้ว +1

    You have a gifted voice... The way you explained is superb... It's a lot of work a bigg salute to the hard work you have put in.
    Just one question or point, the ones using Xampp or Wamp will not get the same errors as php built-in server?

    • @arnavchandra
      @arnavchandra 4 ปีที่แล้ว

      In addition it would be great to install sentinel native or having sentinel native installed in any MVC other than Laravel ... in case just an idea... u can carry forward this same MVC integrating it with Twig and Sentinel it would be awesome... We can have Twig in one part and Sentinel in another ...

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +1

      Thanks buddy.
      Yes they will have the same output on xampp installation.

    • @arnavchandra
      @arnavchandra 4 ปีที่แล้ว

      Apologies by output I mean errors ... Corrected in my comment 😊.
      There are a few, I would say smart logics you used here ... I tried the codes but Xampp was showing 404 without configuring it .. I am using php 7.4.9 ver Xampp

  • @PeterMumford
    @PeterMumford 2 ปีที่แล้ว +1

    This lesson was outstanding. It is the single best example of how to implement OOP in PHP that I've seen.

    • @TheCodeholic
      @TheCodeholic  ปีที่แล้ว

      I am super happy to hear that. Thank you.

  • @PROTOTURKCOM
    @PROTOTURKCOM 4 ปีที่แล้ว +1

    1:01:30 why you didn't use extract() instead of $$? Is there any cons?

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      I think $$ is easier to use. I do not know TBH if there is any cons.

    • @PROTOTURKCOM
      @PROTOTURKCOM 4 ปีที่แล้ว

      Than I believe this code is
      extract($params)
      easier than this :D
      foreach($params as $key => $value){
      $$key = $value;
      }
      don't you think so?

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +1

      I think you are right.
      Just I have not used that before.

    • @PROTOTURKCOM
      @PROTOTURKCOM 4 ปีที่แล้ว +1

      ​@@TheCodeholic you taught me something, I taught you something :) thanks for exchange.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Thanks.

  • @nurharizulaimanmatharith4023
    @nurharizulaimanmatharith4023 4 ปีที่แล้ว +1

    The most greatest work....thanks bro your knowledge is awesome

  • @rafaelrosas59
    @rafaelrosas59 4 ปีที่แล้ว +2

    Thank you so much for this content, the way you explain is very understandable

  • @ИгрокИграющийИгры
    @ИгрокИграющийИгры 4 ปีที่แล้ว +4

    Very, very nicely done tutorial. Great material. Thanks. Only one thing: You are running toooo fast, way to fast. Its hard to follow if, I am making this project while watching. Really hard to stay on same page. While pausing video every 10seconds is an option, its little hard to keep in mind what and why I was doing 1min ago, so I got to rewind back, making me go through same material again and again. Just slow down a little. Would be amazing. Probably just, me, but still. Thanks for amazing content. Best one I found so far. :) Keep it up.

    • @TomiBorchert
      @TomiBorchert 2 ปีที่แล้ว

      this problem is very common amongst tubers. videos are designed for native english speakers.

    • @TomiBorchert
      @TomiBorchert 2 ปีที่แล้ว

      when learning, speed should not be priority.

    • @ИгрокИграющийИгры
      @ИгрокИграющийИгры 2 ปีที่แล้ว

      @@TomiBorchert yes. I Agree posted comment 1 year ago. Still following channel. Really useful information here. Thank you. :)

    • @HustlemanHustlonian
      @HustlemanHustlonian ปีที่แล้ว

      Just play it at half speed in the TH-cam settings

  • @ebedkharistian1472
    @ebedkharistian1472 3 ปีที่แล้ว +1

    Glad I found this 👍👍👍

  • @fajar312
    @fajar312 4 ปีที่แล้ว +1

    thank you, very helpful and very neat and structured like a laravel router

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Thanks buddy

    • @fajar312
      @fajar312 4 ปีที่แล้ว

      @@TheCodeholic You are welcome, friend

  • @kmlclktrk
    @kmlclktrk ปีที่แล้ว +1

    Veri great tutorial🎉❤ thanks a kot

    • @kmlclktrk
      @kmlclktrk ปีที่แล้ว

      İf possible could you tell me what is your choice?
      Laravell or your mvc routing?

  • @jasongoossens
    @jasongoossens 4 ปีที่แล้ว +1

    Awesome course! Your code is clear, and practically explains itself!
    It kinda looks like you're implementing the Node & Express way in PHP?

    • @kofestotech
      @kofestotech 4 ปีที่แล้ว

      I guess slim PHP framework implemented something like that

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Thanks

  • @dmxd
    @dmxd 4 ปีที่แล้ว +1

    Router is pronounced "rauter", or "ruter", but not "roter". Excellent tutorial. Thank you.

    • @dmxd
      @dmxd 4 ปีที่แล้ว +1

      "instead" is pronounced "insted", not "instid".

  • @АнтонВогусов
    @АнтонВогусов 2 ปีที่แล้ว +3

    Hi everybody! May I ask you a question? On 56:08 when you pass an array with classname and non-static function to 'call_user_func()', how does it work with a class but not an object of this class in passed array? If class is passed it should call method statically, but it is non-static method 'contact' (or 'handleContact')? Thank you))

    • @user-cl6zn6sc2k
      @user-cl6zn6sc2k 2 ปีที่แล้ว +2

      yes i have the same question, I don't get why can he call it as static method when is not

    • @ΓιώργοςΜουχταρίδης
      @ΓιώργοςΜουχταρίδης 2 ปีที่แล้ว

      @@user-cl6zn6sc2k Same question here

    • @zaakhirpouzi283
      @zaakhirpouzi283 2 ปีที่แล้ว

      For php8 may refer here php.watch/versions/8.0/non-static-static-call-fatal-error

  • @tarikgadoumi1297
    @tarikgadoumi1297 2 ปีที่แล้ว +1

    ofc i subscribe to you budy ! i like the way you explain keep up hero !!!!!

  • @romanliapkin5174
    @romanliapkin5174 3 ปีที่แล้ว

    Hey, Zura, this project is awesome! You have done a great job. But one thing I would like to the project. Would be cool if the video was splitting into chunks which may observe on GitHub. Now if go on GitHub you see the eventual result. Excuse me for my insolence. THANK YOU for worry about a beginers. А project like this so few on the internet.

    • @romanliapkin5174
      @romanliapkin5174 3 ปีที่แล้ว

      Hmmm, I'm downloaded your project and by switching among commit of the project I found a point that I want to see in the video. Would be good if you add the timing of the video into the commits on GitHub.

  • @rjaysharma
    @rjaysharma 4 ปีที่แล้ว +1

    WoW😘😘, Loved it..👍👍

  • @alikaram98
    @alikaram98 ปีที่แล้ว +1

    wow so good thank's a lot bro

  • @ruhollahh01
    @ruhollahh01 4 ปีที่แล้ว +3

    Thank you for this great tutorial.

  • @mahyarbehzadi738
    @mahyarbehzadi738 3 ปีที่แล้ว +1

    thanks for this great course 👌👌🔥

  • @alisidali580
    @alisidali580 3 ปีที่แล้ว +4

    First of all i want to thank you for this great tutorials, there is one question about call_user_func function because does not accept non static method as second parameter if first parameter is not an instance, and thank you again.

  • @alighazal3978
    @alighazal3978 4 ปีที่แล้ว +1

    thank you so much .. it is an awesome series

  • @ashifahamed9916
    @ashifahamed9916 ปีที่แล้ว

    its really grate, So much helpful.

  • @angelabad8294
    @angelabad8294 2 ปีที่แล้ว +1

    amazing video man.

  • @viggolagerstedtekholm4166
    @viggolagerstedtekholm4166 3 ปีที่แล้ว

    You are amazing dude, solid stuff.

  • @HeshamShawky1
    @HeshamShawky1 2 ปีที่แล้ว +1

    First of all .. thank you for this great tutorial it was very useful
    second thing in 56:40 there's an issue in calling 'handle contact' method in the site controller class ... i think the method is been called in a class context while the method hasn't been declared as static .
    hope to correct me if i'm wrong .
    thank you :)

    • @ThePancakeJedi
      @ThePancakeJedi 2 ปีที่แล้ว

      Yes. How to fix this? I got stuck here.

    • @deZOO77
      @deZOO77 2 ปีที่แล้ว

      @@ThePancakeJedi yo can add static keyword in method declaration

    • @thevipinchand4690
      @thevipinchand4690 2 ปีที่แล้ว +1

      @@ThePancakeJedi You can do this $app->router->post('/contact', [(new SiteController), 'handleContact']);

  • @TahirBhai
    @TahirBhai 4 ปีที่แล้ว

    Amazing tutorial, you just got new subscriber today.

  • @mladentrickovic744
    @mladentrickovic744 4 ปีที่แล้ว +1

    Keep it going buddy u helped a lot.

  • @feli75
    @feli75 4 ปีที่แล้ว

    Thank You, your explanation was very understandable

  • @grupoprosperidade2383
    @grupoprosperidade2383 4 ปีที่แล้ว +1

    Very useful! Thank you.

  • @TheSaurus1233
    @TheSaurus1233 4 ปีที่แล้ว +3

    Thanks a lot for the tutorial! I'm learning a lot. I had one question, how do I add those comments at the top when generating the classes? Thank you.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      You need to open phpstorm settings, find file templatea there and change it.

  • @sviatstupak2162
    @sviatstupak2162 ปีที่แล้ว

    Well done!

  • @Ananaskirsche12
    @Ananaskirsche12 3 ปีที่แล้ว

    Very nice video! One improvement would be to put the timestamps in the description, so one can rewatch one aspect :)

  • @shaikhanuman8012
    @shaikhanuman8012 4 ปีที่แล้ว +2

    Thank you very much sir 👍😊😊😊😊😊😊😊😊😊😊😊😊😊😊 very informative this is type of teaching we are expecting. In one hour we are doing coding very interesting and exciting thanks for providing great lectures.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +1

      Thank you Shaik,
      Glad to read such comments...

    • @shaikhanuman8012
      @shaikhanuman8012 4 ปีที่แล้ว +1

      @@TheCodeholic I am prodly say your my teacher.

  • @safara_umarov
    @safara_umarov 4 ปีที่แล้ว +4

    ❤❤❤❤❤ thank you a lot))

  • @dfordemo981
    @dfordemo981 4 ปีที่แล้ว +1

    Amazing course, I am learning a lot of thins from your videos ____

  • @simplydevelopments3736
    @simplydevelopments3736 3 ปีที่แล้ว +2

    Great Tutorial. On 1.01 why not use extract($params)

  • @TITAN-sv5eg
    @TITAN-sv5eg 2 ปีที่แล้ว

    0:36 why it's not recommended to use in products or websites ?

  • @davidtaiwo1848
    @davidtaiwo1848 ปีที่แล้ว

    great job, i find it easy to do whatever i want with this framework. I have issues identifying if the framework used is laravel or yii2 or any other. I am new to programming and i will appreciate you to clarify this for me. Thanks

    • @TheCodeholic
      @TheCodeholic  ปีที่แล้ว

      It is not Laravel or yii2. It is new framework created to help you understand how frameworks work.

  • @the.mikeyy
    @the.mikeyy 4 ปีที่แล้ว +2

    01:00:54 you can also use PHP's 'extract' function, it basically does the same thing but it is cleaner.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Thanks.

    • @tesszheng4586
      @tesszheng4586 3 ปีที่แล้ว

      awesome, extract() function is a handy one, thanks, I learnt a new function

    • @aidanayala8549
      @aidanayala8549 2 ปีที่แล้ว +1

      using extract is recommended against when dealing with data that could come from an untrusted source

  • @twentxx
    @twentxx 3 ปีที่แล้ว +1

    Thank You very much! It's very helpful ☀️👍
    Also I have a one question. Why we need a function setLayout in Controller if we can use variable $layout for function of Router - layoutContent?

  • @fleckenfurz77
    @fleckenfurz77 2 ปีที่แล้ว

    Hi Zura!
    Thank you so much for the tutorial and for the immense effort behind it!
    But..
    I'm kinda stuck at 56:55min...and i am very confused!
    How is it that you can call handleContact without the SiteController being instantiated???
    Because for me an error is thrown consequently:
    "Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method app\controllers\SiteController::handleContact() cannot be called statically in... (stack trace)...C:\Users\User\Desktop\Code2022\Custom_MVC_Framework\core\Router.php on line 67"

    • @TheCodeholic
      @TheCodeholic  2 ปีที่แล้ว +1

      Thank you.
      I created pinned comment on the video, which explains the problem and what should be done to fix it.

  • @josechirino5168
    @josechirino5168 4 ปีที่แล้ว +2

    This is amazing, thank you

  • @vxarlanchuk
    @vxarlanchuk 4 ปีที่แล้ว +3

    56:52 I got Deprecated: call_user_func() expects parameter 1 to be a valid callback, non-static method app\controllers\SiteController::handleContact() should not be called statically in C:
    ginx-1.18.0\www\mvcFramework\core\Router.php on line 39. PHP v. 7.4.9

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +2

      By the end of the video I have changed the code and don't call the function statically any more...
      Check the final version of the code

    • @Renodarkholes
      @Renodarkholes 4 ปีที่แล้ว

      @@TheCodeholic I have the same problem but I don't find the final version of the code. On Github, the core folder is missing

    • @sekhniashvili
      @sekhniashvili 4 ปีที่แล้ว +1

      @@Renodarkholes If you watch the video series till the end, you will see that I delete the core folder and make it reusable composer package. So the final version is definitely without core and is available on my Github.

    • @Renodarkholes
      @Renodarkholes 4 ปีที่แล้ว

      @@sekhniashvili Ok Thank you for your videos, I like ;-)

    • @Raihan004
      @Raihan004 4 ปีที่แล้ว +5

      it will solve the issues
      if(is_array($callback)){
      return call_user_func([new $callback[0], $callback[1]]);
      }

  • @ShamsuddeenAbdulkadir
    @ShamsuddeenAbdulkadir 3 ปีที่แล้ว +1

    Hello The codeholic, this is a very awesome tutorial and thanks very much for it. I just discovered your channel yesterday and quickly made the decision to take this particular framework tutorial, and i have learned a lot of new things already. I have reached 43:08 mins on this video but my browser doesn't show any content at that point. I am running php 7.4.21 and apache on ubuntu 20.04. any hint on what might be causing it would really help. Thanks one more time.

    • @jadidlar4765
      @jadidlar4765 3 ปีที่แล้ว

      use echo instead of return. Return is not showing messages on me

    • @Korzk
      @Korzk 2 ปีที่แล้ว +3

      I know its late but try to put echo before $this->router->resolve in Application.php

  • @Krlos5605
    @Krlos5605 4 ปีที่แล้ว +1

    I loved the video, but why do you recommend not using the code on a production website?

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว +2

      Because the framework is created in several hours and it is not stable. There will be bugs...

  • @An-Nur_Info-Tech
    @An-Nur_Info-Tech 2 ปีที่แล้ว +2

    I got to know you through freecodecamp on a course posted PHP MVC Framework, the course was so great and here I am on your channel and everything you've been posting was great and easy to learn. Thank you for the great work you've been putting into this.
    I tried integrating bootstrap with composer require tubs/bootstrap instead of the CDN linking, after everything was downloaded into the vendor folder I linked it in the layout folder main.php but it's not working out. Any help on this, please?

  • @freshgold09
    @freshgold09 ปีที่แล้ว

    Thanks for posting this awesome video which is really help me. But I wonder how to replace if there are 2 or more placeholders in views?

  • @rudotel112
    @rudotel112 3 ปีที่แล้ว +1

    It is correct if we renderView from the Response class?

  • @mustafaagha8834
    @mustafaagha8834 3 ปีที่แล้ว

    Amazing tutorial

  • @kuhaniresti
    @kuhaniresti ปีที่แล้ว

    the problem with exiting framework is they are not based on domain driven design, one example of concerns is, they load view classes and other dependencies related to text/html for application/json requests. they executes a lot of defaults that not going to be needed for outputting the reply. imagine having access to title for json request.

  • @terrymurray2076
    @terrymurray2076 3 ปีที่แล้ว +1

    Hi. When using the handleContact method from the SiteController class I get the warning that handleContact should be called statically. Can you help me with this? When I make the method static the warning goes away.

  • @habibulislam152
    @habibulislam152 3 ปีที่แล้ว

    everything is going over my head. I have completed php basics and know php oop systext. Could you please tell me what should I start now?

  • @netman87
    @netman87 4 ปีที่แล้ว

    Oh my this earns my sub

  • @thecodeluminary
    @thecodeluminary 3 ปีที่แล้ว

    Can you do for JavaScript too. Too many JS Frameworks out there. I don't understand the internals. By the way, this tutorial is fire. Learnt a lot. I was only used to Singleton Design Pattern

    • @TheCodeholic
      @TheCodeholic  3 ปีที่แล้ว +1

      Great suggestion! I will try

    • @thecodeluminary
      @thecodeluminary 3 ปีที่แล้ว

      @@TheCodeholic Please how do one host this on a shared hosting (cPanel) - I'm having issues setting it up to test on a development server;
      Thanks

  • @iaskakho5646
    @iaskakho5646 3 ปีที่แล้ว

    Great video, one question why no view class?

    • @TheCodeholic
      @TheCodeholic  3 ปีที่แล้ว

      Maybe in a second version of the framework.

    • @iaskakho5646
      @iaskakho5646 3 ปีที่แล้ว

      @@TheCodeholic you cover the view later when swapping the Router class for an instance. Very good stuff, I switched all my servers to 7.4 cuz of your vids :) Keep it up!

  • @moussaouimehdi734
    @moussaouimehdi734 4 ปีที่แล้ว

    great tutoriel it helps me a lot and took me one day to understand and test all things. I found just one error and i know it will be mentionned in the next videos. In the last video the _404 page not found dosen't work because in the layoutContent method we try to access to the propriety controller of the Application and it's not initialized ($callback null).

  • @spencer5028
    @spencer5028 2 ปีที่แล้ว

    Recommend modeling this with UML so the viewers can get a basic understanding of the structure and flow of requests through the app/

  • @asadbekdeveloper4599
    @asadbekdeveloper4599 2 ปีที่แล้ว

    hello Zura , thank you so much for this lessons. Can you help me about output buffering ? I can't understand it how works

  • @firstignitor
    @firstignitor 2 ปีที่แล้ว

    hello sir..
    thank you so much for all that knowledge and I would really like to thank you.
    Sir.. is it possible to relate that routing system to any design pattern like the front-controller pattern or pipe and filter or may be chain of responsibility?
    is that routing idea related to any design pattern such that it can be documented or reverted in any way to any other design pattern?
    thanks in advance if you regard my question.
    thanks

  • @programmingtestsandproje
    @programmingtestsandproje 3 ปีที่แล้ว

    thank you so much

  • @bgray79
    @bgray79 4 ปีที่แล้ว +1

    I'm currently at time stamp 31:54, am using xampp, Firefox and VS Code. I have tried adding 'users' to the URL, and received 'Object Not Found' error. At this point, when I navigate to the public/index.php file, 'Not Found' is displayed, and not 'Hello World.' Any thoughts on this? Thanks.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      If you are using xampp you have to setup virtual host.
      If you want to follow the tutorial I advice to start the server using php -S. And only switch to apache virtual host later...

    • @bgray79
      @bgray79 4 ปีที่แล้ว

      If i dump the routes array in the router->resolve function, I get '/' and 'home' and '/contact' and 'contact'. When the $callback = $this->routes[$method][$path] line is run, the array does not have a method stored, so $callback is false.

    • @TheCodeholic
      @TheCodeholic  4 ปีที่แล้ว

      Probably you have something differently

    • @bgray79
      @bgray79 4 ปีที่แล้ว

      @@TheCodeholic by virtual host, are you referring to something different than the Apache server on the Xampp control panel?

    • @geneartista9714
      @geneartista9714 4 ปีที่แล้ว +1

      at your cmd:
      - cd 'your public folder path'
      - php -S localhost:8080
      at your web server type:
      localhost:8080

  • @hammadhassanhashmi
    @hammadhassanhashmi 4 ปีที่แล้ว +1

    Did you create .htaccess? Because index.php is not serve when I typed /users it is showing page not found

    • @jjmontgo2
      @jjmontgo2 3 ปีที่แล้ว

      He is using the built-in php web server. .htaccess is for Apache.

  • @topalek
    @topalek 4 ปีที่แล้ว +2

    сразу лайк, неглядя ))

  • @kirilliz
    @kirilliz 4 ปีที่แล้ว +1

    Great video! Thanks for sharing 🙂 is it common practice to do something like Application->$app? Seems a bit.. circular?

  • @creepersonspeed5490
    @creepersonspeed5490 4 ปีที่แล้ว +1

    This is so good

  • @nga3929
    @nga3929 3 ปีที่แล้ว

    very nice!!!