PHP MVC Framework from scratch | Source code included | Quick programming tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • 3 hours of PHP coding to create a Framework from scratch. We will use OOP and make a simple practical application in the end. We'll be using this Framework as the base for future practical projects
    Source code: freephptutorials.com/download...
    Playlist:
    00:00 - Intro
    01:20 - What is a framework
    04:00 - What is MVC
    09:50 - Preparation
    12:30 - Folder structure
    16:40 - Routing
    38:10 - Core files
    49:00 - Views
    01:25:40 - Models
    02:58:30 - Practical project
    more tutorials:
    HTML basics tutorial:
    • 01 What is HTML | HTML...
    Absolute beginner PHP with practical project:
    • Complete PHP beginner ...
    make a social website from scratch:
    • Social Website from sc...
    all crash courses:
    • JSON Crash Course in P...
    code a live chat app in PHP and JavaScript:
    • Live chat app from scr...
    make an eCommerce website from template:
    • #00 PHP Ecommerce webs...
    convert an HTML template to PHP website:
    • HTML Template to PHP W...
    simple signup and login system & security:
    • Simple signup and logi...
    crop images with PHP:
    • PHP - Web Design - How...
    PHP Object Oriented Programming basics:
    • #00 PHP Object Oriente...
    Chart or graph using SVG:
    • HTML Chart using SVG, ...
    Responsive web design:
    • Responsive Web Design ...
    clean pretty URLs:
    • PHP - How to get prett...
    support me on patreon:
    / quickcode
    my facebook:
    quickcode

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

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

    Watched 15 min and the explanations n flow is superb. Just great tutorial! Thanks

  • @faisalasif5986
    @faisalasif5986 ปีที่แล้ว +13

    This course is competing all paid courses .. i am happy to find you in mybest youtube tutor. Love you.

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

      Wow, thanks :)) am happy to hear it

    • @user-on3kr6xd1b
      @user-on3kr6xd1b 2 หลายเดือนก่อน

      ​@@QuickProgramming I completely agree also. but if you get chance to comment on my post that would be greatly appreciated.

  • @jasonwilliams199
    @jasonwilliams199 8 หลายเดือนก่อน

    Great work. This OOP construct is awesome. I'll be watching your series on php photo gallery website next to learn how to implement the MVC Framework into a bigger project.

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

    You are the best teacher i ever meet!

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

    Thank you very much for the lesson! Surprisingly, after watching a couple of videos on the same topic in my native language, I understood more from you! Watching and delving into the subtitles.

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

      Am very happy to hear it and thanks for leaving some feedback😊

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

    thank you and good luck with your projects!

  • @basilistigris640
    @basilistigris640 11 หลายเดือนก่อน +3

    thank you Quick Programing for php mvc from scratch videos is the best to learn php javascript and web development! Great teacher explaining all functionalities and provide the code of the lesson!

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

    Fantastic, I really want this .
    Can not wait to watch this.
    Your your teachings are so great and the impacts it has created in me as a php developer is wonderful.
    keep it up man.
    Thank you Quick Programming.

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

    Awesome job. Thank you bro.
    You are putting quality content on this channel.

  • @melvinreano1221
    @melvinreano1221 9 หลายเดือนก่อน +2

    Great video!! it helps alot specially those aspirant PHP devs

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

    Great tutorial. Very well explained. Thanks a million. :)

  • @premruetaiseeplak1758
    @premruetaiseeplak1758 9 หลายเดือนก่อน +2

    This is from scratch that I looking for! thank you very much.

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

    Thank you for this tutorial. Amazing!
    I liked, commented and subscribed!

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

      Thanks for taking time to leave some feedback and also subscribing😊

  • @enriquesalomon8197
    @enriquesalomon8197 5 หลายเดือนก่อน +2

    SALUTE to this , best tutorial I've ever seen in all PHP tutorial. well explain.

    • @QuickProgramming
      @QuickProgramming  5 หลายเดือนก่อน

      Thank you, I appreciate your compliment and feedback 😊

  • @user-tk1yb6xm2e
    @user-tk1yb6xm2e 8 หลายเดือนก่อน +1

    thank you for this great tutorial !!

  • @GerritforBazeja
    @GerritforBazeja 6 หลายเดือนก่อน

    Thank you very much for sharing your video-lesson. Esspecialy the way your handeling it. step by step makes it very understandeble

  • @Im.ManjeetSingh5
    @Im.ManjeetSingh5 ปีที่แล้ว +1

    Watched other youtbers video but your videos are well explained and understandable for me. Keep up the good work❤

  • @AsmaKhan-qf6gd
    @AsmaKhan-qf6gd ปีที่แล้ว

    well I love your way of teaching and I Got it 100% thank you so muchhhhhhhhhh

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

    this is awesome. have learnt a lot from your tuts

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

    Great job BRO , you are the Best !!!

  • @shaikhanuman8012
    @shaikhanuman8012 11 หลายเดือนก่อน +3

    PHP MVC best course, clear explanation on how MVC pattern works.

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

      Awesome, thanks for the feedback 😊

  • @neilmckenna1742
    @neilmckenna1742 3 หลายเดือนก่อน +1

    Awesome Tutorial, definitely helped me understand PHP MVC.

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

    Your teachings are so great thank you very much , Keep going you are the best

  • @KoJIJoky
    @KoJIJoky 5 หลายเดือนก่อน

    Awesome course, thanks a lot

  • @user-vx1oq3qe5q
    @user-vx1oq3qe5q 4 หลายเดือนก่อน

    Thanks for this tutorial It helps me a lot well explained and solid❤

  • @shubh-kr
    @shubh-kr ปีที่แล้ว +2

    It's very good and clearly explained. It's great for any php/MVC novice. Great job.

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

      Thank you very much!

    • @shubh-kr
      @shubh-kr ปีที่แล้ว

      @@QuickProgramming Wait and in some time you'll be another freeCodeCamp specific to PHP :)
      PHP will thank you.

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

      @@shubh-kr thank you, i really appreciate the vote of confidence🙂

  • @mingming1869
    @mingming1869 3 หลายเดือนก่อน

    ❤Thankyou! gonna do my capstone

  • @DR9Productions
    @DR9Productions 4 หลายเดือนก่อน +1

    Fantastic tutorial! If someone wants to learn mvc, i recomend to start from this video! Very well explained!!! Well done to the author!!!

    • @QuickProgramming
      @QuickProgramming  4 หลายเดือนก่อน +1

      Thanks so much. I really appreciate your recommendation 😊

    • @DR9Productions
      @DR9Productions 4 หลายเดือนก่อน

      @@QuickProgramming keep doing what you doing! Thank you so much for sharing your knowledge with us! Cant wait to see more tutorials from you!!!

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

    Please people do not use this in World Wide Web before you know how to encrypt yor password. NO unencrypted passwords to database. Author should remember to say that to you. Be safe. Very nice tutorial, learned much.

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

    you are the best teacher thanks

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

    You are Best, thanks for all course

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

      You're most welcome and thanks for your awesome feedback😊

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

    Atlast found the perfect solution. Thanks brother

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

      Happy to help! am glad you found it useful. Dont forget to also check the update where i added more functionality here th-cam.com/video/xgFPPT7-OqM/w-d-xo.html

  • @ripon59
    @ripon59 3 หลายเดือนก่อน

    Pure gem

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

    maravilloso aporte gracias, saludos desde venezuela...

  • @ilya_123__
    @ilya_123__ 5 หลายเดือนก่อน +1

    thank you!!

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

    I implemented a router for the framework by modifying the app class and creating a router.php file. This was done because the app I am developing was becoming complex. I’d like to share my implementation and I hope you’ll do a tutorial for that soon. Keep up the good work 🎉

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

      its good you're able to come up with your own implementation, that means you're actually learning and improving. There are many ways to implement the router so as long as it works as you need it, that awesome!

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

      I'm waiting for your sharing, it could be very important for me.

    • @MewtwoStar
      @MewtwoStar 2 หลายเดือนก่อน +1

      @@QuickProgramming can you add router to this MVC framework,
      it will be very helpful for all type of projects.
      thank you.

  • @lawrencenoah9511
    @lawrencenoah9511 6 หลายเดือนก่อน

    Nice tutorial

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

    always the best teacher

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

    Hi. This is a wonderful tutorial. If instead of writing all the PHP code at once, it would be great if HTML was developed along with it. Like if after creating the MVC structure, it was started from the HTML home page and all the changes related to login (necessary PHP on this page) were made. And then if any changes were required on the login html page they would be done there. And then the PHP code that needed to be written would be written by connecting the logging or home controller to it. And then gradually the complex code would be added, sequentially.
    Namespaces, triators and extra functionalities, such as validation rules, requests, posts etc, make this tutorial complex. It is quite difficult for beginners but probably intermediate learners will also find it difficult.

  • @user-so5he3op1q
    @user-so5he3op1q หลายเดือนก่อน

    Thanks a lot

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

    Love it, but I would like to see how you can add in this MVC a shopping page and cart that is connected with a database and handle it from out the admin. I'm new in this and want to learn more on how you can build up from out that base MVC. Product must contain size, color and so on, because when you search for a shopping page with check out nobody use these settings during when you want to buy something you pick your size and color

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

    Thanks bro you are safe my life

  • @anmarm.9487
    @anmarm.9487 ปีที่แล้ว +1

    Thank you for the awesome tutorial. a suggestions, add Request and Response Class, then a simple validation class, You will have a beautiful MVC framework that work as a base for all small websites and APIs hence Response Class. Nevertheless, Great tutorial.

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

      Thanks for the suggestions. i'll be making a follow up tutorial to add more functionality soon. a request class and validation class will be included and a few more classes to speed things up

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

    Awesome content sir ..plz create a playlist for creating own php MVC framework

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

      i'll be using this same framework to make alot of tutorials on converting templates to working websites, so yes there'll be a playlist🙂

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

    Thanks for these great tutorials, I believe you are one of the best on youtube.
    Do you have an Udemy channel, please? just for follow on complete production applications.

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

    For example I have allowedColumns array and I found the issue for example if I insert user I need "created" and when I update I need "modified" but never both together. Does this mean I have to create a new protected variable ?

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

    Good job sir

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

    Thank you sir

  • @user-qr6sq9zp7h
    @user-qr6sq9zp7h 10 หลายเดือนก่อน +1

    Дякую!!!! Gracias!!! THANK you very mach!

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

      You're most welcome 😊😊

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

    Thank you for the lesson , please trying to impliment a website that has admin , how do i arrange the folders and controllers

  • @tunamusic2314
    @tunamusic2314 26 วันที่ผ่านมา

    should we use framework, how tradition php over using framework (like laravel) ?

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

    i dont know why im getting a 0 value for the array with empty value, also $_GET['url'] didnt worked for me i had to use $_SERVER['REQUEST_URI'] did this things changed with php 8?

  • @__-bk6mm
    @__-bk6mm ปีที่แล้ว +1

    This is amazing! Could you do a video showing how to convert the social media project to this structure?

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

      i used this framework to make a simple social website here th-cam.com/video/Hsph_-1EbPA/w-d-xo.html

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

    Nice

  • @Saboor-Hamedi
    @Saboor-Hamedi ปีที่แล้ว +1

    This is amazing brother, but I encounter a problem here, I am using a live server, php -S localhost:8888, and when I run print_r($_GET), I get an empty array, could you help me with that, please.

  • @sakmaestro3852
    @sakmaestro3852 8 หลายเดือนก่อน

    Sir which do u prefer framework laravel, symfony or codeigniter?

  • @HuyTran-cl6ny
    @HuyTran-cl6ny 11 หลายเดือนก่อน +1

    From VietNam with Love ❤❤

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

    Great teacher of our time on TH-cam, Please can we have this tutorial for download letter, i need it so i can be practicing it when am offline

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

      thanks, i think using the youtube app you can download for offline viewing

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

      @@QuickProgramming Thanks, I have downloaded it for offline view. More grace.

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

    Fresh stuff on youtube! Thanks! Question - can this MVC used in production?

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

      yes it can. Thats what i use in my own projects, ofcourse with a few added features but no major differences

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

      @@QuickProgramming Bro, I was looking such video sine 2017! Thank you for confirmation. Now it time to get hands dirty! I SUBSCRIBE!

  • @AsmaKhan-qf6gd
    @AsmaKhan-qf6gd ปีที่แล้ว +1

    can we use in production sir?

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

    Hello Eathorne,
    There is one thing I dont understand about model. When we execute the statement we give a array to execute() function. And now:
    For example the prepaired query is:
    SELECT * FROM users where id = :id
    for execution we give information that [ 'id' =>4] - there is no expressions ":id" (with a colon).
    How does the computer know that it should associate ":id" with "id"? W bindValue we should use (':id' , $x =4)...

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

      the keys of the array must match the keys in the array. in this case the :id will be mapped to 'id' in the array

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

      @@QuickProgramming Unfortunately, I still don't understand :( does this mean that the computer will look for the most similar key? It doesn't have to be identical? Does prefixing the key with a colon have any meaning here?

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

      @@akordeonista the colon is there to tell PDO that the text is a variable to be taken from the array. without the colon it wont look in the array

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

      @@QuickProgramming OK, thats clear, thank you

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

    Hi Eathrone,
    Why do we use 'require' instead of 'include' in that case?

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

      You use include if the file you want to include is optional. Include will throw a warning if the file is not found but the code will continue executing. When you use require, the code stops executing when the file is not found. It throws a fatal error. I prefer require in this case so the cod doesn't continue if the file inst found. You can use include if it suits your purpose better. It's just a matter of preference

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

      @@QuickProgramming thanks a lot

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

    Is this the one from udemy clone? Or simillar?

  • @janedawg09
    @janedawg09 7 หลายเดือนก่อน +1

    great content. you're teaching's really good. appreciate the zoom in/out, makes it easy to follow along and copy the codes afterwards. wanted to finish this in one go but got stuck for 2 days due to my assets files not being read. in case anyone come across the same problem where they can't load css/images/js just add the line before the last line in htaccess shown in the video:
    RewriteCond %{REQUEST_URI} !\.(css|jpg|jpeg|png|gif|ico)$ [NC]

    • @QuickProgramming
      @QuickProgramming  7 หลายเดือนก่อน

      Youre most welcome and thanks for that HTACCESS tip, i'll test it out as well :)

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

    i am so excited for the course can you make course about lumen microframework

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

    hello quick i need your advice i have learned [ html - css - php - mysql - basics of ajax - api - laravel ] what aslo i need to learn to be backend developer and i am junior by the way and what is the next steps to be pro from your opinion ❤❤❤❤

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

      to become a pro, learn OOP. after that, all you need is actual experience. start building actual websites. ask people who need websites if you can build them one for free. even friends and family if possible. the experience you get from it is invaluable. you can then use those same websites as part of your portfolio when looking for work. people care more about your work experience

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

    Hi, one another question if I can.
    Why do we finish method without result by "return false"?
    Could we use also "return true" instead of "return false"?

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

      i finish with false so that if the query doesnt work, it will return false. this can be used inside if statements to know if the query worked or not

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

      @@QuickProgramming thanks for explanation, apprieciate your engagement👍

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

    What is that "show" function you use in Database.php? And thanks fot tutorial. EDIT: Found it :)

  • @jhon.k.3227
    @jhon.k.3227 ปีที่แล้ว +1

    Thanks for the video, you are a great teacher, can I ask if it's possible to send data with Ajax from login page to controller Login in this MVC ? I have tried, but failed.

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

      sure its possible. the code below will send data to the controller of whatever page you're on.
      let xhr = new XMLHttpRequest();
      xhr.addEventListener('readystatechange',function(e){
      if(xhr.readyState == 4 && xhr.status == 200)
      {
      alert(xhr.responseText);
      }
      });
      xhr.open('post','',true);
      xhr.send();
      to send to a specific controller, add the full path to that controller in the open part like this:
      xhr.open('post','/home',true);
      ROOT represents the absolute http path to your project,
      e.g localhost/mvc/public

    • @jhon.k.3227
      @jhon.k.3227 ปีที่แล้ว

      @@QuickProgramming I get a way to pass the ajax Post variables to the controller page, however, when trying to instant the Class I receive a error: Class "Login" not found in C: \xampp\htdocs\MVC\app\controllers\Login.php:12

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

    This video is good. However I am having issues with the .htaccess and rewrite of the URL. For mine, is not rerouting the url to the index page. I have confirmed that mod rewrite was enabled. Any other suggestions about this?

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

      what server type are you using? htaccess files only work with apache, so if its a different server then that could be the problem

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

      @@QuickProgramming I am using Apache. I did figure it out. The AllowOverride directive was set to None. When configured in this manner, htaccess is useless as Apache ignores it. Had to change it to All and then the htaccess file was recognized

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

    Thank you so much, it's greate.
    A Question can you please name your controllers like HomeController or ProductController instade of Home and Product?
    Because we are lost always bettween models and controllers as the file has the same name.
    I tried to change but it takes an error.

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

      there's a better solution with namespaces which we'll get to eventually

    • @__-bk6mm
      @__-bk6mm ปีที่แล้ว

      @@QuickProgramming ooo a teaser of things to come!

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

    The routing is fine but it is how Codeigniter does it. Laravel does it differently and is more robust cause you can clearly define the request method and map the appropriate controller method. With codeigniter example your can’t tell if its a get, post, patch etc without doing additional check. Anyway, it’s good if you are just beginner learning how it works as this is one way to do it.

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

      in this you can also specify the method because the second item is the method, e.g in this link, 'edit' is the method 'website.com/product/edit'.
      laravel is too complex for no reason. code igniter is slightly less complex, so i prefer it. Sure laravel can specify if its a GET or POST request but whats the real world application of that? it just creates a lot of 'page not found' scenarios. better to check using the request class or server method. The complexity of laravel is what i try to avoid by creating my own framework. if i copy laravel exactly then its better i just use laravel because it already exists. i could save time. in the end its all about preference i guess, i prefer making things myself, that way am not lost when a clients wants to change anything

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

    I had a general error when attempting to Insert or update around the 2 hour mark in the video. Changing the line in Database.php if(check) to if(check > 1) fixed it. I dont know if anyone else had the same problem.

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

      Thanks for leaving a tip to others

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

    Hi sir, thanks for this tutorial!
    how do not allow duplicates when entering data in your insert method?

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

      you can use data validation to avoid that. then run the insert method only after checking if values are unique. i made a tutorial on form validation here th-cam.com/video/ymPlbgz6BoU/w-d-xo.html

  • @sakmaestro3852
    @sakmaestro3852 8 หลายเดือนก่อน +2

    Do u hvae udemy course complete project?

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

    whats the difference between first and get row methods?

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

      good question. the get_row function is for running a query, first function uses an array instead. using the first function you dont need to specify a table or even type a query. but there are times when you need to run a complex query and need only one result, thats when you use the get_row function

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

    I had a problem with Model extends Database as a got a fatal error about not extending a Trait

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

      you cant extend a trait, you use it instead. so put it luke this:
      class Model
      {
      use Database;
      //model functions and other code come here
      }

  • @ANILKUMAR-vy4nr
    @ANILKUMAR-vy4nr 5 หลายเดือนก่อน

    Hello to everyone. Please solve my problem.
    When we make a page named about-us then show page not found. Already create about-us.view.php page and Aboutus.php controller.
    Plz help me

    • @QuickProgramming
      @QuickProgramming  5 หลายเดือนก่อน

      Controller file name.should be About_us.php, not Aboutus.php. please note the underscore

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

    Very nice. When is next video using this mvc?

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

      i'll be making a lot of websites using this framework, and we'll improve it over time to speed production times. there will be lots to learn from it

  • @user-xv4fb5wz9i
    @user-xv4fb5wz9i ปีที่แล้ว

    Thanks for the guide. It's really very easy to understand, good work!
    I just have a question about the public directory. What is the best way to implement it so that it is no longer indicated in the URL? So that you only see your domain.
    Many thanks in advance!

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

      the public folder never shows up on the live server. its just there to organise your files better on your local machine. on a live server, you will be given a public folder there as well to put your files. thats where you will add the files that are in your local public folder too

    • @user-xv4fb5wz9i
      @user-xv4fb5wz9i ปีที่แล้ว

      ​@@QuickProgramming Ahh okay, thank you for your response!
      You said in your video that it is not possible to load JS files inside the app folder. Couldn't this be used within the view Pages:

      So the script is inserted as JS content within the head area.
      Maybe they is a better way to insert the JS file for each view page over the controller class? So you don't need to put the script tag on each view page.

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

      @@user-xv4fb5wz9i yes you can load JS & CSS that way but its inefficient. the reason we load JS & CSS files using the tags is because a user's browser can store them locally. This means they only need to be loaded once on the first page load. This is known as caching. loading the js as part of the HTML adds bulk to the code being loaded on every request.
      furthermore, you cant do this for images since you can use the require or include on them. you'll still need to put them in the public folder. so why not just put your JS and CSS files in there too? i just dont see the point of trying to hide JS files when the user can still see the JS code no matter how its being loaded

    • @user-xv4fb5wz9i
      @user-xv4fb5wz9i ปีที่แล้ว

      @@QuickProgramming Thank you for your extensive answer! You are right that JS code is usually always used for client-side rendering. I understand why you used this folder structure for the software. My message does not aim to be more critical of this.
      I'm just testing what I can do with PHP and vanilla JS to make my JS code less readable. I already use techniques like obfuscation and minification.
      In the future I would like to further limit access to the code by running the code on the server and the client only holding the resulting HTML code. Like this example:
      Restricted Access

      Click me

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

    Thanks for this amazing tutorial, I was following your tutorial step by step but in 3:28:55 I got this message Warning: Array to string conversion in E:\xampp\htdocs\mvc\app\core\Model.php on line 70 which is [if (!in_array($key, "$this->allowedColumns")], any advice please? thanks in advance.

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

      do not put quotation marks around this part $this->allowedColumns. if you do that it tries to turn the array into a string, thats why its saying "Array to string conversion" in the error

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

      @@QuickProgramming Thanks, that's right.

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

    which one of the functions in the model class can to retrieve only the user id from a users table if no session has been set?

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

      If there is no session then there is no user id. What are you trying to do? Maybe I can help

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

      If you want to identify a user before they log in, you can use the session I'd. You can get that with this function
      $id = session_id();

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

      ​@@QuickProgramming yes thanks, i am trying to incorporate the email verification function with the mvc model but with my version i am inserting the a row in the verification table when the user successfully signs up at this point no session has been set but i want to insert the verification record for a specific user the users table and the verification table is separated therefore i am trying to insert the verification record where the user_id is equal to the user_id from the users table NOTE the user_id in the verification table is a foreign key from the users table

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

      i tried this code to retrieve the user id from the user table
      $user_id = 96;
      $user_id = $user->first(['user_id' => $user_id]);
      $verify_post['user_id'] = $user_id->user_id;
      but it is hard coded to the user with id of 96 i want to modify this code s that is automatically selects correct user_id

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

    how to remove the public folder in url? because currently .. /publicl/home

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

      It's automatically removed when you put your project on a live server so don't worry about it when on your local machine. On your live server just make sure the contents of your public folder are in the public_html folder on the liver server. Do not put your app folder in your public_html folder, but outside it. Public folder = public_html folder. Search for a video on my channel on how to upload to a live server if you didn't understand my response

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

      Thank you very much for quick reply. and thank you so much for this free but very informative video.
      @@QuickProgramming

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

    Is it different from the one you used in ecommerce?

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

    Hi sir, I didn’t understand why you used unset in update and insert for data, why is it needed at all?

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

      unset is used to remove all keys from the array that are not found in the database table or the ones you dont want to allow edits. if you remove unset, the function will create a query that has columns that dont exist in the table and so your query will not run. e.g if you have a user signup page, you will have the following fields:
      username,
      email,
      password,
      retype_password,
      accept_terms_and_conditions.
      but your database table will have only these columns:
      username,
      email,
      password.
      so when you do this:
      $user->insert($_POST);
      the function will create a query that includes all fields from your form. this query will not work because it contains "retype_password" and "accept_terms_and_conditions".
      the unset part will remove these columns that dont exist in your table. you can also use this to make sure some columns are never edited, e.g the id column or date_created column. the unset part can remove these columns for you automatically from the query. watch this video where i use the framework to make a website th-cam.com/video/Hsph_-1EbPA/w-d-xo.html

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

      @Quick Programming thank you sir, you are the best!

  • @krishu1632
    @krishu1632 4 หลายเดือนก่อน

    Did you use laravel framework in this project?

    • @QuickProgramming
      @QuickProgramming  4 หลายเดือนก่อน

      No, we made our own framework

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

    thanks it was great. better to replace a silent keyboard and mouse, get prepared for the course. You have been copying/moving/making changes/forgot your code back-and-forth many times.

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

      Am a busy person. I don't have the time to prepare for a course. I code in real time. The back and forth is important because it shows you how coding is like in the real world, rather than showing a perfect version which never happens in real life. However, there are plenty of shorter and well peppered videos online, so you don't have to watch mine

  • @andrejoshuab.bautista3969
    @andrejoshuab.bautista3969 4 หลายเดือนก่อน

    I can't seem to load pictures

  • @user-pj2cj4ho3f
    @user-pj2cj4ho3f ปีที่แล้ว

    Great tutorial. It really helps me. I really hate PHP, but in the same time I understand how cool is this language. Following this tutorial, it were many mistakes, and all of them was because I made mistakes in some name of variables (lost concentration I guess). Now I have an issue with inserting new user in the table. When I use show($_POST) it shows me the inputs, but freaking $user->insert($_POST) does not! What is the problem?

    • @user-pj2cj4ho3f
      @user-pj2cj4ho3f ปีที่แล้ว

      The problem is in terms actually. Accepting the terms is part of validate function. And after you put check mark to Accept the term it's value becomes the part of what you try to post. But there is no terms column in users table. If I remove accept the terms from validate function it works. But I don't understand why is it worked for you, man ?

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

    i didn't finish the video yet, but just, at 20:12 it's a bad idea to indicate the directory of your admin files in here, in terms of security, because it makes it very easy for hackers to know where to search for your backoffice!
    you can instead:
    - ask google not to index these pages from google search central
    - add php headers at the beginning of your files: header("X-Robots-Tag: noindex", true);
    - add a meta tag in your html:

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

      That's not the real admin folder. There will be no such folder on the website. All links are simply mod rewrites and not real folders

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

    Please build a news website with mvc and user can also create news content by registering .. and add districts states

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

      alright, will work on that

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

      You just want him to code the project for you? ;)

    • @__-bk6mm
      @__-bk6mm ปีที่แล้ว +1

      @@CivicYt I was thinking that as well, kinda came across as "make my website" lol

  • @user-pv6nc6ek7u
    @user-pv6nc6ek7u 9 หลายเดือนก่อน

    please upload more MVC Project

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

    Do you happen to have a course where I can send emails from my website to my email address using PHP?

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

      yes i do here th-cam.com/video/gortnFd7hgU/w-d-xo.html
      But if you're using an online server, its easier because you simply need one function, like this:
      mail("email@email.com", "a subject goes here", "your message goes here");

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

      @@QuickProgramming Perfect, Thank you very much. Also, sorry to bother but do you have a way to upload and send attachments like images and videos with the email in PHP?

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

    i want to write SELECT * FROM users WHERE id = 1 id != 2.
    How can i modifiy where method inside model class ? its not working when i pass $model->where([id=1],[id=2]). Because array_marge replace delicate key. video Timeline 2:07:23

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

      i think you forgot the '&&' like this:
      SELECT * FROM users WHERE id = 1 && id != 2.
      but this query doesnt make much sense because if id is 1 then its not 2, this means there is no need for the last part of the query which says 'id != 2'

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

      @@QuickProgramming Thanks for the reply. Really appreciate.
      actually, i try to build SQL with an "OR" operation like you.
      like SELECT * FROM users WHERE name = 'A' or name = 'B".
      $data_or = ['name' => 'A', 'name'=>'B']
      $data_or showing only ['name'=>' B'] as an associative array can not contain duplicate key.
      any idea how to build this SQL like you?
      so far my code
      if (!empty($dataOr) && isset($dataOr)) {
      $this->sql .= '(';

      foreach ($dataOr as $key => $value) {
      $this->sql .= $key . ' = ? OR ';
      array_push($this->val, $value);
      }
      $this->sql = rtrim($this->sql, ' OR ');
      $this->sql .= ')';

  • @neelamadhabpanda3959
    @neelamadhabpanda3959 4 หลายเดือนก่อน

    Is there any php oop for beginner course in this channel . Before following MVC

    • @QuickProgramming
      @QuickProgramming  4 หลายเดือนก่อน

      yes, its here th-cam.com/video/wr6EuooKvLU/w-d-xo.html

    • @neelamadhabpanda3959
      @neelamadhabpanda3959 4 หลายเดือนก่อน

      @@QuickProgramming thank you 😊

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

    Can we use this for production?

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

    Greetings to you my PHP hero, and greetings to everyone committed to this unique discussion thread. Please sir, can this MVC be used for public production???

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

      yes it can

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

      Thanks sir. Greetings to you my PHP hero. Please sir, could you do a tutorial for payment wallet using this MVC.

  • @envadd.6556
    @envadd.6556 11 หลายเดือนก่อน +1

    You are the best teacher when it comes to coding for sure!!
    I was wondering how would we go about templating when we have the same header and footer used on all pages without copying them on every page... Where would we use them? Would it be the index page, or would we create something else that gets pulled before and after each view?

    • @QuickProgramming
      @QuickProgramming  11 หลายเดือนก่อน +1

      thanks. you can load any view file, including the header if you save it as a separate file and then load it the same way you load other view files inside another view, e.g $this->view('header');
      i made a simple social website using this framework here. you can get some ideas from there. this is a link to all related videos, but you can just watch the one with the social website for your issue.
      th-cam.com/video/Hsph_-1EbPA/w-d-xo.html&pp=gAQBiAQB

    • @envadd.6556
      @envadd.6556 11 หลายเดือนก่อน

      @@QuickProgramming Thank you for a prompt reply!
      - I am working on a platform and would like to use your MVC instead of procedural PHP as usual. Appreciate all your hard work, as I learn a lot from you!

  • @MiyamotoMusashi-kr2cp
    @MiyamotoMusashi-kr2cp 4 หลายเดือนก่อน

    I am going to build a web portal for our company and I don't want to use any existing php framework. Can I follow this tutorial and use this framework as my reference or structures for our company web portal?

    • @QuickProgramming
      @QuickProgramming  4 หลายเดือนก่อน

      Yes, that's what it's for. I use this too for my own websites. That way you understand every line of code and so fan easily change anything and add new features as you wish

    • @QuickProgramming
      @QuickProgramming  4 หลายเดือนก่อน

      Sure you can

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

    Is this framework the same one used in the udemy website you did?

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

      its very similar yes with some differences

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

      @@QuickProgramming ok than you great work